5

I am getting below error while marshalling. I generated xml's from schemas.

[javax.xml.bind.MarshalException
- with linked exception:
[com.sun.istack.internal.SAXException2: class org.com.AccountsComplexType nor any of its super class is known to this context.

After a little research, some people says "Try adding @XmlSeeAlso(...class)" but the problem is AccountsComplexType class is not a XmlRootElement.

Is there any idea what am I doing wrong?

hellzone
  • 5,393
  • 25
  • 82
  • 148

1 Answers1

1

If you generated the classes form an XML schema then you should bootstrap the JAXBContext from the package name of the generated model or the ObjectFactory class.

bdoughan
  • 147,609
  • 23
  • 300
  • 400
  • I created object with AccountsComplexType act = new ObjectFactory().createAccountsComplexType(); but error still continues. – hellzone Nov 04 '13 at 08:37