我正在尝试部署一个具有 CMIS 连接器到 Websphere 8.5.5 的 GWT 应用程序。在经典开发模式(在Jetty上(或Tomcat服务器上运行时,我没有遇到任何问题 - 两者都使用Oracle 7 JDK。
在部署到 Websphere(使用 IBM JDK(期间,我遇到了这个问题:
com.ibm.ws.webcontainer.webapp.WebApp notifyServletContextCreated SRVE0283E: Exception caught while initializing context: {0}
java.lang.VerifyError
at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.<clinit>(RuntimeBuiltinLeafInfoImpl.java:224)
at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.<init>(RuntimeTypeInfoSetImpl.java:61)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:129)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:81)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.<init>(ModelBuilder.java:152)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilder.java:89)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:431)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:288)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1111)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:372)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
at my.package.core.server.xml.impl.XmlDataBindingServiceJAXBImpl.getJaxbContext(XmlDataBindingServiceJAXBImpl.java:245)
at my.package.core.server.xml.impl.XmlDataBindingServiceJAXBImpl$1.makeObject(XmlDataBindingServiceJAXBImpl.java:72)
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)
at my.package.core.server.xml.impl.XmlDataBindingServiceJAXBImpl.parse(XmlDataBindingServiceJAXBImpl.java:158)
at my.package.core.server.xml.impl.XmlDataBindingServiceJAXBImpl.parse(XmlDataBindingServiceJAXBImpl.java:128)
at my.package.core.server.license.LicenseProvider.readFromXml(LicenseProvider.java:155)
at my.package.core.server.license.LicenseProvider.get(LicenseProvider.java:123)
at my.package.core.server.license.LicenseProvider.get(LicenseProvider.java:50)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
at my.package.core.server.services.i18n.I18NConfigurationServiceImpl.getLanguages(I18NConfigurationServiceImpl.java:53)
at my.package.core.server.schema.SchemaLoaderImpl.scanPackage(SchemaLoaderImpl.java:150)
at my.package.core.server.schema.SchemaLoaderImpl.loadSchema(SchemaLoaderImpl.java:204)
at my.package.core.server.schema.SchemaLoaderImpl.loadSchema(SchemaLoaderImpl.java:195)
at my.package.core.server.schema.CustomSchemaLoaderImpl.loadSchema(CustomSchemaLoaderImpl.java:71)
at my.package.core.server.services.SchemaServiceImpl.getSchema(SchemaServiceImpl.java:144)
at my.package.core.server.SchemaDBInitialize.start(SchemaDBInitialize.java:91)
at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:70)
at my.package.core.server.LsServer.start(LsServer.java:161)
at my.package.core.server.AppInitializer.contextInitialized(AppInitializer.java:210)
它不是完整的堆栈跟踪 - 我只是包含了 websphere 内容停止的部分。这一行my.package.core.server.xml.impl.XmlDataBindingServiceJAXBImpl.getJaxbContext(XmlDataBindingServiceJAXBImpl.java:245)
简单地从javax.xml.bind
调用 JAXBContext。这一直持续到com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl,它来自jaxb-impl
依赖项,它是对chemistry-opencmis-client-impl
的暂时依赖。
这些是我的 POM 文件中的依赖项声明:
<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
<artifactId>chemistry-opencmis-client-impl</artifactId>
<version>0.8.0</version>
<exclusions>
<exclusion>
<artifactId>chemistry-opencmis-client-bindings</artifactId>
<groupId>org.apache.chemistry.opencmis</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
<artifactId>chemistry-opencmis-client-bindings-websphere</artifactId>
<version>0.8.0</version>
</dependency>
我确实尝试使用IBM JDK编译该项目。
我想我可能在运行时缺少一些库,但我不确定是哪些库,当然为什么(如前所述,我在部署到 Tomcat 时没有这个问题(。我将不胜感激任何帮助或提示,因为我已经为此苦苦挣扎了很长时间。
@Florian Müller的建议与(如评论中所述(将Axis2升级到1.7.5一起工作。然后,我们在部署冲突的jaxb库期间遇到了很多VerifyErrors。删除所有 xml 解析依赖项(将它们放入为 WebSphere 概要文件提供的作用域中( - 在我们的例子中,这些是geronimo-stax-api,xercesImpl,xml-apis,XML-beans,激活 - 最终解决了这个问题。