0
votes

I have faced with a problem while trying to deploy my web application to GlassFish 3.1.2. Looks like there is JAXB libraries conflict: my app uses v.1 JAXB implementation, while, AFAIK, GlassFish 3.1.2 contains its own v2 JAXB implementation. Can this overlap cause fail during deployment? How to act in this situation?

Exception message:

Caused by: rpt.engine.util.EngineException: javax.xml.bind.JAXBException: Provider com.sun.xml.bind.ContextFactory_1_0_1 could not be instantiated: javax.xml.bind.JAXBException - with linked exception: [java.lang.NoSuchFieldError: theInstance]
- with linked exception: [javax.xml.bind.JAXBException - with linked exception: [java.lang.NoSuchFieldError: theInstance]] at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:160) at javax.xml.bind.ContextFinder.find(ContextFinder.java:308) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:446) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:409) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:313)

1

1 Answers

2
votes

This looks like a problem with the JAXB version bundled with Glassfish 3.1.2 which is 2.2.5.
You can try to upgrade the bundled JAXB version manually:

  • Download new version at http://jaxb.java.net/ (complete package)

  • Backup the files /GLASSFISH_HOME/glassfish/lib/jaxb-osgi.jar and /GLASSFISH_HOME/glassfish/lib/endorsed/jaxb-api-osgi.jar

  • Extract the files jaxb-osgi.jar and jaxb-api-osgi.jar from new-version.zip/lib to /GLASSFISH_HOME/glassfish/lib/ and /GLASSFISH_HOME/glassfish/lib/endorsed/