使用osgi bundle MOXy“XML绑定文档”

时间:2014-08-04 09:22:09

标签: java xml jaxb osgi moxy

我在OSGI环境(E4 RCP)中使用MOXy,并且在与MOXy" XML绑定文档"相结合时对类加载器问题有点困惑。能力。

约束:
被编组的对象在不同的​​osgi包中分开。

案例1:
域类中的标准JAXB注释。创建JAXBContext很好,独立于不同的osgi-bundle。它适用于标准JAXB以及MOXy。

案例2:
映射信息由" xml绑定文档"提供。每包一份文件。 现在,创建域类的JAXBContext失败,但出现以下异常:

Exception [EclipseLink-50025] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.JAXBException
Exception Description: Could not load class [xx.xx.YY] declared in the external metadata file.  Please ensure that the class name is correct, and that the correct ClassLoader has been set.
at org.eclipse.persistence.exceptions.JAXBException.couldNotLoadClassFromMetadata(JAXBException.java:390)
at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.getXmlBindingsClasses(JAXBContext.java:1140)
at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:1029)
at org.eclipse.persistence.jaxb.JAXBContext.<init>(JAXBContext.java:182)  

案例3:
映射信息再次由&#34; xml绑定文档&#34;提供。只创建位于相同osgi-bundles 中的域类的JAXBContext

由于osgi-environment,它似乎显然是一个类加载器问题。我错过了一个观点,还是只是MOXy中的一个错误?

0 个答案:

没有答案