5

我在编组时遇到错误。我从模式中生成了 xml。

[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.

经过一番研究,有人说“尝试添加@XmlSeeAlso(...class)”,但问题是AccountsComplexType 类不是XmlRootElement。

有什么想法我做错了什么吗?

4

1 回答 1

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.

于 2013-11-01T15:51:32.753 回答