1 Reply Latest reply on Feb 25, 2012 8:54 PM by spyhunter99

    WSN Producer, JAXBException with xs:any

    spyhunter99 Novice

      I'm writing a WSN producer which has a payload of xs:any for sending messages. It's expecting some class with an @XmlRootElement annotation, which my class "MyAlertMessageDefinition" does have. When it attempt to send the message, I get the following exception.

       

      Caused by: javax.xml.bind.MarshalException

      - with linked exception:

      Caused by: javax.xml.bind.JAXBException: class MyAlertMessageDefinition nor any of its super class is known to this context.

                at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:594)

                at com.sun.xml.bind.v2.runtime.property.SingleReferenceNodeProperty.serializeBody(SingleReferenceNodeProperty.java:105)

       

      I've been able to marshal/unmarshal jaxb classes without issue before, the question is, how do I make this work?

       

      I think I can simply change the WSN wsdls/xsd to replace the xs:any with that of MyAlertMessageDefinition, then rebuild the class libraries from wsconsume, but is this the best solution?

       

      Is there some kind of context accessor for JAXBcontext or something along the lines so that I can add the MyAlertMessageDefinition into the context?