I'm generating a jar which is to be dropped into a commercial software product. That jar conforms to the commercial software's api and depends on a second jar, which contains (among other things) a set of POJOs generated from an XSD. However, it fails when trying to instantiate JAXBContext when I drop it in.
I get:
"1 counts of IllegalAnnotationExceptions"
javax.xml.bind.JAXBElement does not have a no-arg default constructor.
this problem is related to the following location:
at javax.xml.bind.JAXBElement
at mypackage.MyClass
...
JAXBContext.newInstance("mypackage");
...
My XSD (summarized for brevity) looks like this:
<xsd:schema ... >
<xsd:element name="MyClass" type="myType" />
<xsd:complexType name="myType">
...
</xsd:complextType>
</xsd:schema>
I thought perhaps that the issue was that Classes at the "xsd:element" level didn't exist, but the problem persists even when I set XJC up to create MyClass and I've verified that MyClass has a public no-arg constructor.
So, I've looked at several other SO questions (and all over the internet, in fact). None of them gave me enough understanding to solve this problem, which may just be a poor reflection on me. Can anybody shed some insight? Or give me alternative tests to conduct to break this down?