我在WebSphere 8.5上启动Web应用程序时遇到此错误。应用程序通过DB2上的MyBatis存储过程调用。用户使用REST框架触发使用REST WS的调用。春天将所有东西粘在一起。相同的应用程序在Tomcat 7上运行正常。有没有人看到这个错误?任何帮助将不胜感激)。看起来它无法为应用程序初始化Context和Dependency Injection容器。
stacktrace:
[26.11.13 10:20:36:339 MSK] 000000a3 BeansDeployer E BeansDeployer deploy
java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException
at org.apache.webbeans.portable.AnnotatedElementFactory.newAnnotatedType(AnnotatedElementFactory.java:150)
at org.apache.webbeans.config.BeansDeployer.deployFromClassPath(BeansDeployer.java:484)
at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:171)
at org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication(AbstractLifeCycle.java:124)
at org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication(WebContainerLifecycle.java:78)
at com.ibm.ws.webbeans.common.CommonLifeCycle.startApplication(CommonLifeCycle.java:106)
at com.ibm.ws.webbeans.services.JCDIServletContainerInitializer.onStartup(JCDIServletContainerInitializer.java:85)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:613)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:409)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:746)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1175)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)
skip ...
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)
Caused by: java.lang.ArrayIndexOutOfBoundsException
at org.apache.webbeans.portable.AbstractAnnotatedCallable.setAnnotatedParameters(AbstractAnnotatedCallable.java:66)
at org.apache.webbeans.portable.AnnotatedConstructorImpl.<init>(AnnotatedConstructorImpl.java:56)
at org.apache.webbeans.portable.AnnotatedElementFactory.newAnnotatedType(AnnotatedElementFactory.java:117)
... 108 more
答案 0 :(得分:6)
在Websphere 8上遇到同样的问题。这个答案基于user3040441的评论。为了避免对其他人寻求解决这个问题的额外研究。
https://code.google.com/p/guava-libraries/wiki/Release15#A_note_on_JEE6_/_CDI_1.0
关于JEE6 / CDI 1.0的说明
在Guava 15.0中添加了一种解决方法,使其与CDI 1.1兼容 (用于JEE7容器)导致带有CDI 1.0的番石榴出现问题(使用过 在JEE6容器中。)
如果您在CDI 1.0环境中使用Guava,则应该使用 guava-15.0-cdi1.0.jar而不是普通的番石榴罐。在Maven, 依赖关系可以指定为:
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>15.0</version>
<classifier>cdi1.0</classifier>
</dependency>
https://code.google.com/p/guava-libraries/issues/detail?id=1527#c20
已删除 Guava 16.0 的JSR-330注释,希望如此 CDI不会有进一步的问题。现在我们只会遇到问题 当利用注释的代码停止工作时。