If i create JAXBContext (JAXBContext.newInstance(Abc.class))
and run this class file in my system, it works fine. But the same code throws error, when I run it as an applet, with the same JRE (and same PC). First error I get is -
javax.xml.bind.JAXBException: jaxb.properties in package com/test/package does not contain the javax.xml.bind.context.factory property.
at javax.xml.bind.ContextFinder.find(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
If I add a jaxb.properties in the package com/test/package, I get another error. This time it is -
javax.xml.bind.JAXBException
- with linked exception:
[java.lang.NoSuchMethodException: com.sun.xml.internal.ws.developer.JAXBContextFactory.createContext([Ljava.lang.Class;, java.util.Map)]
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.find(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
jaxb.properties contents -
javax.xml.bind.context.factory=com.sun.xml.internal.ws.developer.JAXBContextFactory
I have tried changing java version too. What might be possible cause of this error.