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

  • SEARCH
  • Home
  • 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-RS web service (using jersey) that accepts a JAXB object as
Situation: jax-ws web service on Weblogic appserver; wsdl first development, jaxb customizations in external
I have a Spring application that uses JAX-WS to consume another web service. Everything
I'm trying to access a web service with JAX-WS using: Dispatch<Source> sourceDispatch = null;
I am developing a RESTful web service using JAX-RS. I am using JAXB to
I'd like to avoid embedding HTML in XML returned from my JAX-RS web service,
i have local WSDL file. i tried to create JAX-WS Web service client which
I have a jax-ws web service developped using netbeans 7 and glassfish 3.1.2 .
I have a jax-rpc web service. When i try to pass xml to the
I have an AXIS2/JAX-WS web service using a code first implementation (yes I know,

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.