1 Reply Latest reply on May 7, 2013 10:41 AM by Nick Friedrich

    Unable to deploy on JBoss AS 7.1 with Arquillian and com.google.common.collect

    Nick Friedrich Newbie

      Hello,

       

      I am trying to do some testing with Arquillian. Due to some dependencies I need several third-party-packages for some test. But i get following error:

       

       

      ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.deployment.unit."flurstueck.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."flurstueck.war".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$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_43]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_43]
          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_43]
      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.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)
          ... 22 more
      

       

       

       

      After some research I found out, that the error shouldn't occur with an jboss-scanning.xml to prevent the scanning of com.google.common.collect. So I created the following jboss-scanning.xml:

       

       

      <scanning xmlns="urn:jboss:scanning:1.0">
      
          <path name="flurstueck.war/WEB-INF/classes">
              <exclude name="com.google.common.collect"/>
          </path>
      
      </scanning>
      
      

       

      I also tried other pathnames like "flurstueck.war" or "WEB-INF/classes". But none is working.

      I put the file in "WEB-INF" in my deployed archive.

       

      I am still fresh to Java EE, so i might be missing something.

      Any help is appreciated.