Can JAXB handle multiple “root” elements?

前端 未结 2 1969
伪装坚强ぢ
伪装坚强ぢ 2021-01-13 10:43

I have a schema similar to the following...



         


        
2条回答
  •  伪装坚强ぢ
    2021-01-13 11:10

    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.

提交回复
热议问题