我如何使用jaxb.index文件? [英] How do I use a jaxb.index file?
本文介绍了我如何使用jaxb.index文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在
javax.xml.bind.JAXBException: "org.example.mypackage" doesnt contain ObjectFactory.class or jaxb.index
尝试创建 JAXBContext
使用 JAXBContext.newInstance(String contextPath)
。我猜测有一种通常的方式来创建和维护一个jaxb.index文件。
while trying to create a JAXBContext
using JAXBContext.newInstance(String contextPath)
. I'm guessing there's a "usual" way to create and maintain a jaxb.index file.
推荐答案
jaxb.index文件只是包含JAXB注释的包中的类列表。
The jaxb.index file is just a listing of the classes in the containing package that have JAXB annotations.
文件中的每一行都是类的简单名称,而不是其完全限定名称。
Each line in the file is a class's simple name, not its fully qualified name.
您可以在这里阅读更多内容: http://cmaki.blogspot.com/2007/09/annotated-jaxb-classes.html
You can read more here: http://cmaki.blogspot.com/2007/09/annotated-jaxb-classes.html
这篇关于我如何使用jaxb.index文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文