title: JAXB, CXF: There's no ObjectFactory with an @XmlElementDecl for the element ... with
body: <p>I'm creating a WSDL first webservice with JAXB and CXF. I do not own the WSDL, so I cannot make changes to it. I'm using <a href="ftp://ftp.ihe.net/TF_Implementation_Material/ITI/wsdl/PIXManager.wsdl" rel="noreferrer">ftp://ftp.ihe.net/TF_Implementation_Material/ITI/wsdl/PIXManager.wsdl</a> as my WSDL. I used CXF 2.3.0 to generate Java classes.</p>
  
  <p>Java class generation went fine, but when I'm trying to run this in a web application, I get an error</p>
  
  <pre><code>com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 17 counts of IllegalAnnotationExceptions
  </code></pre>
  
  <p>The 17 counts are of the format</p>
  
  <pre><code>There's no ObjectFactory with an @XmlElementDecl for the element {urn:hl7-org:v3}assignedDevice.
          this problem is related to the following location:
              at protected javax.xml.bind.JAXBElement org.hl7.v3.QUQIMT021001UV01AuthorOrPerformer.assignedDevice
  </code></pre>
  
  <p>When I go to the class mentioned, i.e. QUQIMT021001UV01AuthorOrPerformer and look at the field assignedDevice, I see this</p>
  
  <pre><code>@XmlElementRef(name = "assignedDevice", namespace = "urn:hl7-org:v3", type = JAXBElement.class)
  protected JAXBElement&lt;COCTMT090300UV01AssignedDevice&gt; assignedDevice;
  </code></pre>
  
  <p>When I look at the ObjectFactory of the package, I see this</p>
  
  <pre><code>private final static QName _COCTMT090303UV01AssignedDeviceAssignedDevice_QNAME = new QName("urn:hl7-org:v3", "assignedDevice");
  </code></pre>
  
  <p>All my 17 errors are similar. What can I do during my codegen or runtime in order to get my service work?</p>