jaxbri does not properly create new instances when using inheritance of
abstract elements
-----------------------------------------------------------------------------------------
Key: AXIS2-4043
URL: https://issues.apache.org/jira/browse/AXIS2-4043
Project: Axis 2.0 (Axis2)
Issue Type: Bug
Affects Versions: 1.4
Reporter: Jake Goulding
Attachments: inheritance.wsdl, Main.java
Summary of WSDL:
schema a has abstract type "output" and concrete subclass "output-instance".
schema b imports schema a and references abstract element "output"
Error:
Unable to create JAXBContext for class: test.Outputs
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of
IllegalAnnotationExceptions
There's no ObjectFactory with an @XmlElementDecl for the element
{urn:/test/types}output.
this problem is related to the following location:
at protected java.util.List test.Outputs.output
at test.Outputs
at
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)
at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:372)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
at test.TestServiceStub.<clinit>(TestServiceStub.java:441)
at Main.main(Main.java:14)
The corresponding line in the Stub is:
jc = javax.xml.bind.JAXBContext.newInstance(test.Outputs.class);
If this is changed to
jc = javax.xml.bind.JAXBContext.newInstance(test.Outputs.class,
test.types.ObjectFactory.class);
This exception is no longer thrown, and everything else seems to proceed as
usual.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]