[jboss-user] [JBoss Web Services] - WSN Producer, JAXBException with xs:any

spyhunter99 do-not-reply at jboss.com
Sat Feb 25 12:50:33 EST 2012

spyhunter99 [https://community.jboss.org/people/spyhunter99] created the discussion

"WSN Producer, JAXBException with xs:any"

To view the discussion, visit: https://community.jboss.org/message/719691#719691

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?

Reply to this message by going to Community

Start a new discussion in JBoss Web Services at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120225/667ced19/attachment.html 

More information about the jboss-user mailing list