2 Replies Latest reply on Sep 20, 2013 2:40 PM by Vishal Shanbhag

    Problem with deployment - Weld fails with runtime exception

    Vishal Shanbhag Newbie

      Background : We have an application called which uses popular java based frameworks and gets deployed on Jboss AS 7.1.1.

      The key frameworks are GWT, Spring, Hibernate. Of course each of these frameworks adds their own set of dependencies thus adding to a relatively large set of libraries all of it managed via maven. We also use OWASP-html-sanitizer library which in turn has a dependency on google's guava.

      I would like to file a bug report based on a problem I encountered. However I can't seem to find a "create issue" option on System Dashboard - JBoss Issue Tracker. Also I am not entirely certain where I should file the bug report (jboss / guava) . So leaving this out for discussion so hopefully some one knowledgeable in the matter can guide me.

       

      Problem:

      Yesterday while doing a routine code build and deploy the deploy start failing without any apparent reason. See stack trace below. Search on the net yielded a reference to an old bug https://issues.jboss.org/browse/WELD-1007. The stack trace I have appears to be very similar.  The bug appears to be fixed a while ago and so I tested on Jboss AS 7.1.1 that I downloaded fresh yesterday after encountering the problem. However the problem occurred again.

      I looked around internet and among others ideas one talked about overriding the default loaded modules through use of jboss-deployment-structure.xml in the ear. I tried that, but it only changed the error. The deployment continued to fail.

       

      Work Around:

      Further research revealed that OWASP-html-sanitize uses guava 11.0 or higher in its pom. Jboss 7.1.1 comes packaged with module settings for guava 11.0. So in theory there should not be a problem (and never was before yesterday). However it turns out that Guava released a new release candidate version 15.rc1 yesterday (http://search.maven.org/#search|ga|1|guava). OWASP-html-sanitizer picked up this release candidate in its pom.xml and then deployment seemed to cause below issue.

      As workaround I only changed my app's pom.xml to override the guava dependency setting to

      <dependency>

      <groupId>com.google.guava</groupId>

      <artifactId>guava</artifactId>

      <version>11.0</version>

      </dependency>

       

      Now build and deploy worked fine.

       

      Stack Trace:

      16:51:34,381 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015877: Stopped deployment YuDoApp-1.0.ear in 2835ms

      16:51:34,384 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "YuDoApp-1.0.ear"

      16:51:37,744 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "YuDoMailUI-1.0.war"

      16:51:44,510 INFO  [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016002: Processing weld deployment YuDoApp-1.0.ear

      16:51:44,670 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016002: Processing weld deployment YuDoMailUI-1.0.war

      16:51:44,862 INFO  [org.jboss.weld.deployer] (MSC service thread 1-6) JBAS016005: Starting Services for CDI deployment: YuDoApp-1.0.ear

      16:51:48,072 INFO  [org.jboss.weld.Version] (MSC service thread 1-6) WELD-000900 1.1.5 (AS71)

      16:51:48,111 INFO  [org.jboss.weld.deployer] (MSC service thread 1-8) JBAS016008: Starting weld service for deployment YuDoApp-1.0.ear

      16:51:49,468 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."YuDoApp-1.0.ear".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."YuDoApp-1.0.ear".WeldService: com.google.common.collect.ComputationException: java.lang.ArrayIndexOutOfBoundsException: 3

          at org.jboss.as.weld.services.WeldService.start(WeldService.java:83)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) [rt.jar:1.6.0_27]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.6.0_27]

          at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_27]

      Caused by: com.google.common.collect.ComputationException: java.lang.ArrayIndexOutOfBoundsException: 3

          at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:397)

          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:149)

          at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:139)

          at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118)

          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:49)

          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:40)

          at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:355)

          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)

          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)

          at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)

          at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:393)

          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:149)

          at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:139)

          at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118)

          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:49)

          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:40)

          at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:355)

          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)

          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)

          at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)

          at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:393)

          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:149)

          at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86)

          at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115)

          at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:171)

          at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336)

          at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82)

          at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)

          ... 5 more

      Caused by: java.lang.ArrayIndexOutOfBoundsException: 3

          at org.jboss.weld.introspector.jlr.WeldConstructorImpl.<init>(WeldConstructorImpl.java:103)

          at org.jboss.weld.introspector.jlr.WeldConstructorImpl.of(WeldConstructorImpl.java:66)

          at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:205)

          at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118)

          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:49)

          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:40)

          at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:355)

          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)

          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)

          at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)

          at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:393)

          ... 32 more

       

      16:51:57,267 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment YuDoMailUI-1.0.war in 7576ms

      16:51:57,277 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015877: Stopped deployment YuDoApp-1.0.ear in 7585ms

      16:51:57,278 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015863: Replacement of deployment "YuDoApp-1.0.ear" by deployment "YuDoApp-1.0.ear" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"YuDoApp-1.0.ear\".WeldService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"YuDoApp-1.0.ear\".WeldService: com.google.common.collect.ComputationException: java.lang.ArrayIndexOutOfBoundsException: 3"}}