Aplicación de inicio de excepción en webspere 8.5
Frecuentes
Visto 3,896 veces
6
I'm getting this error starting web application on WebSphere 8.5. Application calls thru MyBatis stored procedures on DB2. User triggers calls using REST WS, implemented using Jersey framework. Spring glues everything together. The same application works fine on Tomcat 7. Did anyone see this error? Any help will be appreciated). It looks like it fails to initialize Context and Dependency Injection container for the application.
El 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
1 Respuestas
6
Had the same problem on Websphere 8. This answer is based on the user3040441's comment. To avoid the extra research for others looking to solve this.
https://code.google.com/p/guava-libraries/wiki/Release15#A_note_on_JEE6_/_CDI_1.0
A note on JEE6 / CDI 1.0
A workaround added in Guava 15.0 to make it compatible with CDI 1.1 (used in JEE7 containers) caused problems for Guava with CDI 1.0 (used in JEE6 containers).
If you're using Guava in a CDI 1.0 environment, you should use guava-15.0-cdi1.0.jar instead of the normal Guava jar. In Maven, the dependency can be specified as:
<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
JSR-330 annotations have been removed for Guayaba 16.0, so hopefully there will be no further issues with CDI. Now we'll just have issues when code that was taking advantage of the annotations stops working.
Respondido 18 Feb 14, 15:02
Talk about a complete needle in a haystack to try to figure this out. If I knew where you were I'd buy you a beer. Others can view the dependency hierarchy tab on the pom that has the issue and search for "guava" because it may be a hidden dependency on a different dependency you are including. You can then right click the guava dependency and choose disable, save, go to the .xml view and verify there is now an exclusion for guava. Then manually replace it by importing the dependency Stefan provided above. I went around in circles on this for days. Thank you! - Russ
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas java spring jersey websphere or haz tu propia pregunta.
Judging from the stacktrace CDI is kicking in to bootstrap your application insntead of Spring. Make sure that you don't have a
beans.xml
in your file (or related jar files) as that will trigger CDI. - M. DeinumIn any case, this looks like a product defect. I recommend opening a PMR with IBM. - Brett Kail
Issue was resolved. The problem was that project uses Guava, but the used version supports latest CDI. And WebSphere uses old version of CDI implementation from Appache OpenWeb. There's a version of Guava library that addresses this issue. In the pom file:<dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>15.0</version> <classifier>cdi1.0</classifier> </dependency> - user3040441
This is one heck of a strange bug. @user3040441, if you submit your comment (which is really an answer) as the answer to this question I'd be happy to upvote that as well. - butallmj
Encountered the same issue: <version>15.0</version> <classifier>cdi1.0</classifier> - blandger