XSD is having element like this
<xs:element name="companyname" type="xs:anyType" minOccurs="0"/>
JAXB Generated Class is having code like this
protected Object companyname;
To fetch the data we are using
final ElementNSImpl element = (ElementNSImpl)atGiven;
To resolve this element we can use either of this.
If we use this import, it is working in Eclipse. But failing in osgi.
java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to org.apache.xerces.dom.ElementNSImpl
If we use this import, paxrunner with Equinox is failing to do boot delegation com.sun.*
We have two solutions:
replace xs:anyType to xs:string if permits.
Make sure that boot delegation works.
It is better not to use code specific to implementation.
It is better to use interface. Due to this used Node and resolved the issue.