title: problem subclassing ObjectFactory in jax-ws web service
body: <p>In a jax-ws web service I cannot directly access the JaxbContext object. JaxbContext uses the class ObjectFactory. I tried extending it (like in <a href="https://jaxb.dev.java.net/guide/Adding_behaviors.html" rel="nofollow noreferrer">Jaxb Adding Behaviors</a>). I put generated code in <code>ObjectFactoryBase</code>, then added</p>
  
  <pre><code>public class ObjectFactory extends ObjectFactoryBase {//.. overriden methods}
  </code></pre>
  
  <p>However <code>IllegalAnnotationsException</code> came up when publishing to weblogic, because it cannot find a certain <code>@XmlElementDecl</code> present in <code>ObjectFactoryBase</code>. When I move the method with this <code>@XmlElementDecl</code> to <code>ObjectFactory</code> it works.</p>
  
  <p>No luck with adding <code>@XmlSeeAlso({ ObjectFactoryBase.class })</code> either.</p>
  
  <p>Edit: I now discovered that the generated ObjectFactory is <em>not even used</em> 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?</p>
  
  <p>Any ideas?</p>