JAXB annotations appear to be missing from classes in JBoss EAP 6

Solution Verified - Updated -

Issue

  • While executing the following code snippet:
import com.redhat.gss.MyObject;
import javax.xml.bind.JAXBContext;
JAXBContext jc = JAXBContext.newInstance(MyObject.class); 
  • It runs fine in a standalone environment, but in JBoss, getting the following error:
Caused by: com.sun.istack.SAXException2: 
unable to marshal type "com.my.example.request.Payment" as an element 
because it is missing an @XmlRootElement annotation
  • The @XmlRootElement annotation is present on MyObject, though. Why can't JAXB see it?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content