2012-12-24 99 views
0

我在嘗試將我的Web應用程序部署到GlassFish 3.1.2時遇到了問題。看起來有JAXB庫衝突:我的應用程序使用v.1 JAXB實現,而AFAIK和GlassFish 3.1.2包含它自己的v2 JAXB實現。這可能會導致在部署過程中失敗嗎?如何在這種情況下采取行動?GlassFish的JAXB實現

異常消息:

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

這看起來與Glassfish的3.1.2是2.2.5捆綁的JAXB版中的問題。
您可以嘗試手動升級捆綁的JAXB版本:

  • http://jaxb.java.net/(整套)

  • 備份文件下載新版本/GLASSFISH_HOME/glassfish/lib/jaxb-osgi.jar/GLASSFISH_HOME/glassfish/lib/endorsed/jaxb-api-osgi.jar

  • 中提取文件JAXB的osgi.jarJAXB-API-osgi.jarnew-version.zip/lib/GLASSFISH_HOME /的glassfish/LIB//GLASSFISH_HOME /的glassfish/LIB /認可/

+0

感謝答覆。去嘗試。 –