Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 498391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:52:28+00:00 2026-05-13T05:52:28+00:00

In a jax-ws web service I cannot directly access the JaxbContext object. JaxbContext uses

  • 0

In a jax-ws web service I cannot directly access the JaxbContext object. JaxbContext uses the class ObjectFactory. I tried extending it (like in Jaxb Adding Behaviors). I put generated code in ObjectFactoryBase, then added

public class ObjectFactory extends ObjectFactoryBase {//.. overriden methods}

However IllegalAnnotationsException came up when publishing to weblogic, because it cannot find a certain @XmlElementDecl present in ObjectFactoryBase. When I move the method with this @XmlElementDecl to ObjectFactory it works.

No luck with adding @XmlSeeAlso({ ObjectFactoryBase.class }) either.

Edit: I now discovered that the generated ObjectFactory is not even used by the jaxws web service. So the above error message are not so relevant any more. Any idea why it is generated but not used?

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:52:29+00:00Added an answer on May 13, 2026 at 5:52 am

    JAXB ObjectFactories are strange beasts. Your question has many facets, so I’ll just answer with a bullet list:

    • JAXB1 relied on ObjectFactory to create instances of the bound classes, but with JAXB2 everything is a POJO, and the ObjectFactory becomes mostly unnecessary. It’s still generated by XJC, partly for reasons of backwards compatibility.
    • The annotations on an ObjectFactory are complex and non-obvious, but since it’s a generated class, this usually doesn’t matter, and most people don’t look at it anyway.
    • ObjectFactory is still useful on occasion because it provides factory methods for bound classes that need a JAXBElement wrapper, and it’s much easier to use the provided factory methods than to do this by hand.
    • The JAXWS web service may choose not to use the ObjectFactory, because it’s not strictly speaking necessary. However the JAXBContext may still load and parse it, depending on how the context was initialized.
    • I’ve never tried creating an ObjectFactory myself; if the model was XJC-generated then the generated ObjectFactory is usually enough, and if you have a hand-written JAXB model, the ObjectFactory is usually completely unnecessary anyway.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JAX-RPC web service that I am attempting to consume using Spring.
I have a JAX-RPC (Java) web service that needs to return a complex polymorphic
I am trying to consume the Exchange 2010 Web Service interface using JAX-WS. I'm
I want to share an object between my servlets and my webservice (JAX-WS) by
I have a simple web service sitting on our internal network. I used SOAPUI
I'm getting started in developing web services using JAX-WS. I'm trying to implement classes
I'm implementing a JAX-WS webservice that will be consumed by external Java and PHP
I'm currently looking for ways to create automated tests for a JAX-RS (Java API
I im developing a web application, its a servlet which basically acts as a
I've got a service running at a fixed location in the network, with a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.