Equinox java.lang.NoClassDefFoundError

不想你离开。 提交于 2019-12-08 19:59:17
bdoughan

You will need to be sure that you import the javax.xml.bind package or the JAXB public API bundle in the META-INF/MANIFEST.MF file.

OSGi Example (MOXy used as JAXB (JSR-222) provider)

I had a similar problem and managed to solve it using AccessController.doPrivileged like this:

public void start(BundleContext bundleContext) throws Exception {

    JAXBContext con =  AccessController.doPrivileged(new PrivilegedExceptionAction<JAXBContext>() {

        public JAXBContext run() throws JAXBException {

            // needs to run here otherwise throws AccessControlException
            return JAXBContext.newInstance(Activator.class);
        }
    });         
}

Hope it helps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!