开发者

JAXB - ClassNotFoundException: com.sun.xml.bind.ContextFactory_1_0_1

开发者 https://www.devze.com 2022-12-30 16:31 出处:网络
I am getting error : GC 16192K->1983K(260160K), 0.0101954 secs] avax.xml.bind.JAXBException: Provider com.sun.xml.bind.ContextFactory_1_0_1 not

I am getting error :

GC 16192K->1983K(260160K), 0.0101954 secs]
avax.xml.bind.JAXBException: Provider com.sun.xml.bind.ContextFactory_1_0_1 not
- with linked exception:
java.lang.ClassNotFoundException: com.sun.xml.bind.ContextFactory_1_0_1]
       at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:152)
       at javax.xml.bind.ContextFinder.find(ContextFinder.java:258)
       at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
       at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
       at javax.xml.bin开发者_StackOverflow社区d.JAXBContext.newInstance(JAXBContext.java:244)

I have added following jars:

jaxp-api.jar , jaxb-api.jar , jsr173_1.0_api.jar , jaxb-impl.jar , jaxb1-impl.jar , jaxb-libs.jar , jaxb-xjc.jar , jax-qname.jar , jaxrpc.jar , jaxrpc-api.jar , relaxngDatatype.jar

Can someone help me out what wrong with this code.

Note : The code works when I am running with sample code.


Adding this.getClass().getClassLoader() in new Instance method should fix your problem...

0

精彩评论

暂无评论...
验证码 换一张
取 消