I have a schema similar to the following...
You will need to leverage a factory class annotated with @XmlRegistry
(usually called ObjectFactory
). That class will contain a create
method for each possible root element annotated with @XmlElementDecl
. See this article I wrote for more details and examples.
I am a newbee to jaxb. I had one doubt regarding jaxb
@XmlElementDecl(namespace = "http://mtop/nra/xsd/tca/v1", name = "thresholdCrossingAlert", substitutionHeadNamespace = "http://mtop/fmw/xsd/cei/v1", substitutionHeadName = "commoneventInformation")
This is the annotation where I am getting the exception as
"java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions"
ThresholdCrossingAlert.class
is extending the class EventInformationType.class
and EventInformationType.class
is extending the class CommonEventInformation.class
inturn,
Is this any problem with my annotation definition or error in Initializing the JaxbContext
.