0

I've managed to deploy a simple Web application to Websphere 8.5, but unable to start it. It throws an ArrayIndexOutofBoundsException while starting my application.

We have been using Tomcat7 so far for our web app. It's a simple web-app with JSPs, JSs and Servlets.

I've tried a lot of options to deploy the application on Websphere, but the latest hurdle i'm facing is the ArrayIndexOutofBoundsException.

I tried to deploy the same application (a mini version) which contained only one servlet, and it was successful. But when I have multiple servlets, I get this exception. Below is my stack trace

[8/12/14 12:15:55:463 IST] 00000046 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:749)
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)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:774)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2182)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:994)
at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:502)
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)
... 27 more

I read a couple of other posts from people who faced more or less the same problem, but they were talking about Spring or Guava, none of which I use here. As a result, the solutions I read there did not solve my problem.

Can any one throw light on a solution? It would be helpful to a very great extent.

Additional Info:

I'm developing my project on Eclipse Kepler and using the Webshpere 8.5 plugin to deploy on Websphere application server.

Thanks, Sriram

ᄂ ᄀ
  • 5,669
  • 6
  • 43
  • 57
Sriram Sridharan
  • 720
  • 18
  • 43
  • You have to attach source of your class where you are using CDI. Otherwise it will be very hard to tell something more about the problem. – Gas Dec 08 '14 at 20:58
  • @Gas, I'm trying to install an application that has many classes. I'm sorry if I'm sounding too elementary, but I am not aware of what CDI is. Can you help? I can attach the source of my class then.. – Sriram Sridharan Dec 09 '14 at 04:18
  • Just attach one of your servlets. CDI is context and dependency injection - see [cdi tutorial here](http://docs.oracle.com/javaee/6/tutorial/doc/giwhb.html) – Gas Dec 09 '14 at 08:45
  • I suspect this is a product issue since I would expect a proper error message rather than ArrayIndexOutOfBoundsException if it's not an actual code problem. I recommend opening a PMR with IBM. – Brett Kail Dec 09 '14 at 15:16
  • What version of JSF are you using? To use CDI with JSF in WAS you need to run a specific supported version. If you're using new versions of JSF + CDI(annotations) it will not work. Unfortunatelly you'll need to fall back to a supported JSF version. We hope IBM fix this ASAP as this is a very annoying bug. Check this link please: http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=/com.ibm.websphere.express.iseries.doc/info/iseriesexp/ae/cweb_cdi_integration.html – groo Dec 10 '14 at 12:28
  • I am one of the authors of Apache OpenWebBeans and I've seen this issue on some JVMs. The problem might be that you have an annotation on your class but the Annotation class itself is not on the classpath. According to the Java langspec the JVM needs to ignore this annotation, but some JVMs simply blow up with exactly this funny ArrayIndexOutOfBoundsException Exception. Please check what J9 version you are using and whether you can update to a more recent one. – struberg Apr 09 '15 at 10:05

1 Answers1

2

Actually it turns out my project was indeed referencing to guava. It was using guava version 15.0. I changed the version to 16.0 and included then in my shared library.. and it solves the issue. Apologies for overlooking guava.. old have saved a lot of time !!

Sriram Sridharan
  • 720
  • 18
  • 43