Java – JAXB, CXF: elements without objectfactory and @ xmlelementdecl

I am using JAXB and CXF to create a WSDL first web service I don't own WSDL, so I can't modify it I use ftp://ftp.ihe.net/TF_Implementation_Material/ITI/wsdl/PIXManager.wsdl As my WSDL I use CXF 2.3 0 generates Java classes

Java class generation is fine, but when I try to run it in a web application, I get an error

com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 17 counts of IllegalAnnotationExceptions

17 numbers are the format

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

When I go to class, i.e. quqimt021001uv01authororperformer, look at the assigned devices, and I see this

@XmlElementRef(name = "assignedDevice",namespace = "urn:hl7-org:v3",type = JAXBElement.class)
protected JAXBElement<COCTMT090300UV01AssignedDevice> assignedDevice;

When I see the objectfactory of the package, I see this

private final static QName _COCTMT090303UV01AssignedDeviceAssignedDevice_QNAME = new QName("urn:hl7-org:v3","assignedDevice");

All my 17 mistakes are similar What can I do during code or runtime to make my service work?

Solution

What java version do you use at runtime? When running with Java 6, I have similar problems with OTA architecture This problem was eliminated by making the following changes to the Maven configuration:

>Using JAXB impl 2.1* (instead of 2.2) to match the JAXB version included in Java 6. > Use jax-ws 2.1 instead of 2.2 to match Java 6 and JAXB 2.1 x. > add the option frontend to the maven CXF CodeGen plugin and set it to jaxws21 (or use the "- Fe jaxws21" option if using wsdl2java on the command line)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>