1 2 Previous Next 16 Replies Latest reply: Dec 8, 2010 7:41 AM by José Freitas RSS

    Cannot deploy application containing google guava

    Nick Belaevski Master

      Hello all,

       

      We've switched to google guava library from google-collections in Richfaces project and now there are deployment issues with the latest JBoss AS 6 snapshot, here is stack trace I'm getting trying to deploy richfaces-showcase application:

       

       

      16:21:14,642 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to PostClassLoader: name=vfs:///D:/jboss-6.0.0-SNAPSHOT/server/default/deploy/ric
      hfaces-showcase.war state=ClassLoader mode=Manual requiredState=PostClassLoader: org.jboss.deployers.spi.DeploymentException: Error during deploy: vfs:///D:/jboss-6.0.0-SNAPSHOT/se
      rver/default/deploy/richfaces-showcase.war
              at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) [:2.2.0.Alpha6]
              at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:185) [:2.2.0.Alpha6]
              at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.Alpha6]
              at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.Alpha6]
              at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.Alpha6]
              at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.Alpha10]
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.Alpha10]
              at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.Alpha10]
              at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.Alpha10]
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.Alpha10]
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.Alpha10]
              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.Alpha10]
              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.Alpha10]
              at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.Alpha6]
              at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.Alpha6]
              at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.Alpha6]
              at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0-SNAPSHOT]
              at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:130) [:0.1.0.Alpha1]
              at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:240) [:0.1.0.Alpha1]
              at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192) [:0.1.0.Alpha1]
              at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:59) [:0.1.0.Alpha1]
              at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74) [:0.1.0.Alpha1]
              at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:94) [:0.1.0.Alpha1]
              at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.1.0.Alpha1]
              at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.1.0.Alpha1]
              at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.1.0.Alpha1]
              at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.1.0.Alpha1]
              at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135) [:0.1.0.Alpha1]
              at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146) [:0.1.0.Alpha1]
              at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90) [:0.1.0.Alpha1]
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_17]
              at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [:1.6.0_17]
              at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [:1.6.0_17]
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [:1.6.0_17]
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) [:1.6.0_17]
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) [:1.6.0_17]
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_17]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_17]
              at java.lang.Thread.run(Thread.java:619) [:1.6.0_17]
      Caused by: java.lang.Error: Error visiting "/D:/jboss-6.0.0-SNAPSHOT/server/default/deploy/richfaces-showcase.war/WEB-INF/lib/guava-r05.jar/com/google/common/collect/LinkedListMult
      imap$ValueForKeyIterator.class"
              at org.jboss.classloading.plugins.vfs.VFSResourceVisitor.visit(VFSResourceVisitor.java:268) [jboss-classloading-vfs.jar:2.2.0.Alpha7]
              at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:407) [jboss-vfs.jar:3.0.0.CR5]
              at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5]
              at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5]
              at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5]
              at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5]
              at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:395) [jboss-vfs.jar:3.0.0.CR5]
              at org.jboss.classloading.plugins.vfs.VFSResourceVisitor.visit(VFSResourceVisitor.java:102) [jboss-classloading-vfs.jar:2.2.0.Alpha7]
              at org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule.visit(VFSDeploymentClassLoaderPolicyModule.java:181) [:2.2.0.Alpha6]
              at org.jboss.scanning.plugins.DeploymentUnitScanner.scan(DeploymentUnitScanner.java:111) [:1.0.0.Alpha5]
              at org.jboss.scanning.spi.helpers.UrlScanner.scan(UrlScanner.java:96) [:1.0.0.Alpha5]
              at org.jboss.scanning.deployers.ScanningDeployer.deploy(ScanningDeployer.java:90) [:1.0.0.Alpha5]
              at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.Alpha6]
              ... 37 more
      Caused by: java.lang.RuntimeException: Error visiting resource: org.jboss.classloading.plugins.vfs.VFSResourceContext@1556d56, visitor: org.jboss.scanning.annotations.plugins.Gener
      icAnnotationVisitor@17d59ff
              at org.jboss.scanning.plugins.visitor.IgnoreSetErrorHandler.handleError(IgnoreSetErrorHandler.java:57) [:1.0.0.Alpha5]
              at org.jboss.scanning.plugins.visitor.ReflectResourceVisitor.visit(ReflectResourceVisitor.java:91) [:1.0.0.Alpha5]
              at org.jboss.scanning.annotations.plugins.AnnotationsScanningPlugin.visit(AnnotationsScanningPlugin.java:89) [:1.0.0.Alpha5]
              at org.jboss.scanning.spi.helpers.ScanningPluginWrapper.visit(ScanningPluginWrapper.java:112) [:1.0.0.Alpha5]
              at org.jboss.classloading.plugins.visitor.FederatedResourceVisitor.visit(FederatedResourceVisitor.java:101) [jboss-classloading.jar:2.2.0.Alpha7]
              at org.jboss.classloading.plugins.vfs.VFSResourceVisitor.visit(VFSResourceVisitor.java:264) [jboss-classloading-vfs.jar:2.2.0.Alpha7]
              ... 49 more
      Caused by: java.lang.ArrayIndexOutOfBoundsException: 2
              at org.jboss.reflect.plugins.ConstructorInfoImpl.<init>(ConstructorInfoImpl.java:95) [jboss-reflect.jar:2.2.0.Alpha9]
              at org.jboss.reflect.plugins.introspection.ReflectConstructorInfoImpl.<init>(ReflectConstructorInfoImpl.java:68) [jboss-reflect.jar:2.2.0.Alpha9]
              at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getConstructors(IntrospectionTypeInfoFactoryImpl.java:174) [jboss-reflect.jar:2.2.0.Alpha9]
              at org.jboss.reflect.plugins.ClassInfoImpl.getDeclaredConstructors(ClassInfoImpl.java:446) [jboss-reflect.jar:2.2.0.Alpha9]
              at org.jboss.scanning.plugins.visitor.ClassHierarchyResourceVisitor.handleClass(ClassHierarchyResourceVisitor.java:79) [:1.0.0.Alpha5]
              at org.jboss.scanning.plugins.visitor.ReflectResourceVisitor.doVisit(ReflectResourceVisitor.java:108) [:1.0.0.Alpha5]
              at org.jboss.scanning.plugins.visitor.ReflectResourceVisitor.visit(ReflectResourceVisitor.java:86) [:1.0.0.Alpha5]
              ... 53 more
      
      
      

       

      Removing guava.jar fixes the problem, can please somebody look at the issue?

      There are google-collections included with JBoss 6 in weld.deployer, so is it a conflict with these classes or just a problem in guava itself?

      P.S. Checked with guava r5 & r6.
        • 1. Re: Cannot deploy application containing google guava
          Kabir Khan Master
          The failing line in the stacktrace has to do when the parameter annotations are created. Looking at the stack trace it seems to be when creating parameters for the constructor of 
          ValueForKeyIterator in http://code.google.com/p/guava-libraries/source/browse/tags/release06/src/com/google/common/collect/LinkedListMultimap.java.
          It has a constructor whose signature is:
          public ValueForKeyIterator(@Nullable Object key, int index)
          I added a test for https://jira.jboss.org/browse/JBREFLECT-135 but can't get it to fail on OS X's JVM. Which JVM are you using? 

          If you want to play more with the test, it is 

          testParameterAnnotationsNotAllParametersAnnotated() in http://anonsvn.jboss.org/repos/jbossas/projects/jboss-reflect/trunk/src/test/java/org/jboss/test/classinfo/test/AnnotatedClassInfoTest.java

          • 2. Re: Cannot deploy application containing google guava
            Nick Belaevski Master

            That is: Java version: 1.6.0_17, Sun Microsystems Inc. (build 1.6.0_17-b04) on Windows.

            • 3. Re: Cannot deploy application containing google guava
              Kabir Khan Master

              Can you check out http://anonsvn.jboss.org/repos/jbossas/projects/jboss-reflect/trunk, run a 'mvn install' and see if you get any failures?

              • 4. Re: Cannot deploy application containing google guava
                Nick Belaevski Master

                Checked, but the problem is still here:

                 

                 

                Caused by: java.lang.ArrayIndexOutOfBoundsException: 2
                        at org.jboss.reflect.plugins.ConstructorInfoImpl.<init>(ConstructorInfoImpl.java:95) [jboss-reflect.jar:2.2.0-SNAPSHOT]
                        at org.jboss.reflect.plugins.introspection.ReflectConstructorInfoImpl.<init>(ReflectConstructorInfoImpl.java:68) [jboss-reflect.jar:2.2.0-SNAPSHOT]
                        at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getConstructors(IntrospectionTypeInfoFactoryImpl.java:174) [jboss-reflect.jar:2.2.0-SNAPSHOT]
                        at org.jboss.reflect.plugins.ClassInfoImpl.getDeclaredConstructors(ClassInfoImpl.java:446) [jboss-reflect.jar:2.2.0-SNAPSHOT]
                        at org.jboss.scanning.plugins.visitor.ClassHierarchyResourceVisitor.handleClass(ClassHierarchyResourceVisitor.java:79) [:1.0.0.Alpha5]
                        at org.jboss.scanning.plugins.visitor.ReflectResourceVisitor.doVisit(ReflectResourceVisitor.java:108) [:1.0.0.Alpha5]
                        at org.jboss.scanning.plugins.visitor.ReflectResourceVisitor.visit(ReflectResourceVisitor.java:86) [:1.0.0.Alpha5]
                        ... 57 more
                
                
                
                • 5. Re: Cannot deploy application containing google guava
                  Kabir Khan Master

                  I have not done anything to fix the problem since I cannot reproduce it. I take it you managed to build jboss-reflect.jar from trunk, which means the tests there must have passed for you?

                   

                  Can you put a breakpoint and see if the constructor I think was the problem is the right one?

                  • 6. Re: Cannot deploy application containing google guava
                    Kabir Khan Master

                    I have managed to reproduce the problem when I try to get the constructor for this non-static inner class

                     

                     

                    public class ClassInfoParameterAnnotationsNotAllParametersAnnotated
                    {
                       public ClassInfoParameterAnnotationsNotAllParametersAnnotated(@SimpleAnnotation int i, int j)
                       {
                       }
                    
                       public void method(@SimpleAnnotation int i, int j)
                       {
                       }
                    
                       public class InnerClass
                       {
                          public InnerClass(@SimpleAnnotation int i, int j)
                          {
                          }
                       }
                    }
                     
                    

                     

                    I'll try to fix it

                    • 7. Re: Cannot deploy application containing google guava
                      Kabir Khan Master

                      This is fixed in jboss-reflect/trunk. I'm seeing if I can get it into AS 6.0.0.M4, which is due to be tagged today, so the cutoff time might already have passed

                      • 8. Re: Cannot deploy application containing google guava
                        Nick Belaevski Master

                        Kabir,

                         

                        Thank you for response! I've tried the latest jboss-reflect/trunk and here is what I see now:

                         

                         

                        18:24:34,408 ERROR [AbstractKernelController] Error installing to PostClassLoader: name=vfs:///D:/jboss-6.0.0-SNAPSHOT/server/default/deploy/richfaces-showcase.war state=ClassLoade
                        r mode=Manual requiredState=PostClassLoader: org.jboss.deployers.spi.DeploymentException: Error during deploy: vfs:///D:/jboss-6.0.0-SNAPSHOT/server/default/deploy/richfaces-showca
                        se.war
                                at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) [:2.2.0.Alpha6]
                                at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:185) [:2.2.0.Alpha6]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.Alpha6]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.Alpha6]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.Alpha6]
                                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.Alpha6]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.Alpha6]
                                at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.Alpha6]
                                at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0-SNAPSHOT]
                                at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:130) [:0.1.0.Alpha1]
                                at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:148) [:0.1.0.Alpha1]
                                at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.1.0.Alpha1]
                                at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.Alpha10]
                                at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.Alpha10]
                                at org.jboss.profileservice.dependency.ProfileServiceController.activate(ProfileServiceController.java:188) [:0.1.0.Alpha1]
                                at org.jboss.profileservice.AbstractProfileService.activateProfile(AbstractProfileService.java:170) [:0.1.0.Alpha1]
                                at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:117) [:0.1.0.Alpha1]
                                at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:89) [:0.1.0.Alpha1]
                                at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:97) [:0.1.0.Alpha1]
                                at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:130) [:6.0.0-SNAPSHOT]
                                at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0-SNAPSHOT]
                                at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
                                at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
                                at java.lang.Thread.run(Thread.java:619) [:1.6.0_18]
                        Caused by: java.lang.Error: Error visiting "/D:/jboss-6.0.0-SNAPSHOT/server/default/deploy/richfaces-showcase.war/WEB-INF/lib/guava-r06.jar/com/google/common/collect/AbstractMultim
                        ap$WrappedList$WrappedListIterator.class"
                                at org.jboss.classloading.plugins.vfs.VFSResourceVisitor.visit(VFSResourceVisitor.java:268) [jboss-classloading-vfs.jar:2.2.0.Alpha7]
                                at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:407) [jboss-vfs.jar:3.0.0.CR5]
                                at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5]
                                at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5]
                                at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5]
                                at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:409) [jboss-vfs.jar:3.0.0.CR5]
                                at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:395) [jboss-vfs.jar:3.0.0.CR5]
                                at org.jboss.classloading.plugins.vfs.VFSResourceVisitor.visit(VFSResourceVisitor.java:102) [jboss-classloading-vfs.jar:2.2.0.Alpha7]
                                at org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule.visit(VFSDeploymentClassLoaderPolicyModule.java:181) [:2.2.0.Alpha6]
                                at org.jboss.scanning.plugins.DeploymentUnitScanner.scan(DeploymentUnitScanner.java:111) [:1.0.0.Alpha5]
                                at org.jboss.scanning.spi.helpers.UrlScanner.scan(UrlScanner.java:96) [:1.0.0.Alpha5]
                                at org.jboss.scanning.deployers.ScanningDeployer.deploy(ScanningDeployer.java:90) [:1.0.0.Alpha5]
                                at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.Alpha6]
                                ... 41 more
                        Caused by: java.lang.RuntimeException: Error visiting resource: org.jboss.classloading.plugins.vfs.VFSResourceContext@52732d, visitor: org.jboss.scanning.annotations.plugins.Generi
                        cAnnotationVisitor@18f22f3
                                at org.jboss.scanning.plugins.visitor.IgnoreSetErrorHandler.handleError(IgnoreSetErrorHandler.java:57) [:1.0.0.Alpha5]
                                at org.jboss.scanning.plugins.visitor.ReflectResourceVisitor.visit(ReflectResourceVisitor.java:91) [:1.0.0.Alpha5]
                                at org.jboss.scanning.annotations.plugins.AnnotationsScanningPlugin.visit(AnnotationsScanningPlugin.java:89) [:1.0.0.Alpha5]
                                at org.jboss.scanning.spi.helpers.ScanningPluginWrapper.visit(ScanningPluginWrapper.java:112) [:1.0.0.Alpha5]
                                at org.jboss.classloading.plugins.visitor.FederatedResourceVisitor.visit(FederatedResourceVisitor.java:101) [jboss-classloading.jar:2.2.0.Alpha7]
                                at org.jboss.classloading.plugins.vfs.VFSResourceVisitor.visit(VFSResourceVisitor.java:264) [jboss-classloading-vfs.jar:2.2.0.Alpha7]
                                ... 53 more
                        Caused by: java.lang.reflect.GenericSignatureFormatError
                                at sun.reflect.generics.parser.SignatureParser.error(SignatureParser.java:103) [:1.6.0_18]
                                at sun.reflect.generics.parser.SignatureParser.parseSimpleClassTypeSignature(SignatureParser.java:262) [:1.6.0_18]
                                at sun.reflect.generics.parser.SignatureParser.parseClassTypeSignatureSuffix(SignatureParser.java:270) [:1.6.0_18]
                                at sun.reflect.generics.parser.SignatureParser.parseClassTypeSignature(SignatureParser.java:244) [:1.6.0_18]
                                at sun.reflect.generics.parser.SignatureParser.parseClassSignature(SignatureParser.java:171) [:1.6.0_18]
                                at sun.reflect.generics.parser.SignatureParser.parseClassSig(SignatureParser.java:126) [:1.6.0_18]
                                at sun.reflect.generics.repository.ClassRepository.parse(ClassRepository.java:34) [:1.6.0_18]
                                at sun.reflect.generics.repository.ClassRepository.parse(ClassRepository.java:23) [:1.6.0_18]
                                at sun.reflect.generics.repository.AbstractRepository.<init>(AbstractRepository.java:56) [:1.6.0_18]
                                at sun.reflect.generics.repository.GenericDeclRepository.<init>(GenericDeclRepository.java:30) [:1.6.0_18]
                                at sun.reflect.generics.repository.ClassRepository.<init>(ClassRepository.java:30) [:1.6.0_18]
                                at sun.reflect.generics.repository.ClassRepository.make(ClassRepository.java:47) [:1.6.0_18]
                                at java.lang.Class.getGenericInfo(Class.java:2254) [:1.6.0_18]
                                at java.lang.Class.getTypeParameters(Class.java:621) [:1.6.0_18]
                                at sun.reflect.generics.scope.AbstractScope.lookup(AbstractScope.java:68) [:1.6.0_18]
                                at sun.reflect.generics.scope.AbstractScope.lookup(AbstractScope.java:72) [:1.6.0_18]
                                at sun.reflect.generics.factory.CoreReflectionFactory.findTypeVariable(CoreReflectionFactory.java:91) [:1.6.0_18]
                                at sun.reflect.generics.visitor.Reifier.visitTypeVariableSignature(Reifier.java:147) [:1.6.0_18]
                                at sun.reflect.generics.tree.TypeVariableSignature.accept(TypeVariableSignature.java:25) [:1.6.0_18]
                                at sun.reflect.generics.repository.ConstructorRepository.getParameterTypes(ConstructorRepository.java:76) [:1.6.0_18]
                                at java.lang.reflect.Method.getGenericParameterTypes(Method.java:282) [:1.6.0_18]
                                at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl$2.run(IntrospectionTypeInfoFactoryImpl.java:230) [jboss-reflect.jar:2.2.0-SNAPSHOT]
                                at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl$2.run(IntrospectionTypeInfoFactoryImpl.java:218) [jboss-reflect.jar:2.2.0-SNAPSHOT]
                                at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_18]
                                at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getMethods(IntrospectionTypeInfoFactoryImpl.java:217) [jboss-reflect.jar:2.2.0-SNAPSHOT]
                                at org.jboss.reflect.plugins.ClassInfoImpl.getDeclaredMethods(ClassInfoImpl.java:416) [jboss-reflect.jar:2.2.0-SNAPSHOT]
                                at org.jboss.scanning.plugins.visitor.ClassHierarchyResourceVisitor.handleClass(ClassHierarchyResourceVisitor.java:80) [:1.0.0.Alpha5]
                                at org.jboss.scanning.plugins.visitor.ReflectResourceVisitor.doVisit(ReflectResourceVisitor.java:108) [:1.0.0.Alpha5]
                                at org.jboss.scanning.plugins.visitor.ReflectResourceVisitor.visit(ReflectResourceVisitor.java:86) [:1.0.0.Alpha5]
                                ... 57 more
                        
                        
                        

                         

                        Is it the only module I have to rebuild?

                        • 9. Re: Cannot deploy application containing google guava
                          Kabir Khan Master

                          Yes that's the only module. I guess these google libraries show we have not tested inner classes well enough, and while these inner classes were getting ignored before they now get picked up with our new aggressive annotation scanning. I think you can add a jboss-scanning.xml to your deployment to limit what gets scanned so you avoid this problem, but I am not familiar with its format so I'll ask Ales to provide some information there.

                           

                          We will do some work on inner classes, but that will take some time (and I am on holidays next week)

                          • 11. Re: Cannot deploy application containing google guava
                            Ales Justin Master

                            You can add this error / exception to the ones we already ignore.

                            See "scanning-deployers-jboss-beans.xml":

                             

                            <bean name="ResourceErrorHandler">
                                  <install method="addIgnored">
                                      <parameter>java.lang.NoClassDefFoundError</parameter>
                                  </install>
                            

                             

                            Or what's your app's file/dir structure?

                            So, I can correctly suggest you how your jboss-scanning.xml should look like,

                            if you wanna ignore guava.jar wrt scanning.

                             

                            Some more info can be found here as well:

                            * http://java.dzone.com/articles/jboss-microcontainer-scanning

                            • 12. Re: Cannot deploy application containing google guava
                              Marcel Kolsteren Apprentice

                              The same error (GenericSignatureFormatError) occurred when I tried to deploy a Seam 3 application using JBoss AS 6.0 M4.

                               

                              In this case the problem was caused by an inner class from Weld extensions (which seems to be inspired on a Google collections class):

                               

                              org/jboss/weld/extensions/util/collections/AbstractMultimap$WrappedList$WrappedListIterator

                               

                              I circumvented the problem by adding this fragment to the ResourceErrorHandler bean of scanning-deployers-jboss-beans.xml:

                               

                                    <install method="addIgnored">

                                        <parameter>java.lang.reflect.GenericSignatureFormatError</parameter>
                                    </install>
                              • 13. Re: Cannot deploy application containing google guava
                                Nick Belaevski Master

                                Ales, Kabir,

                                 

                                Thank you much! I've added the following WEB-INF/jboss-scanning.xml:

                                 

                                <scanning xmlns="urn:jboss:scanning:1.0">
                                 
                                  <path name="WEB-INF/classes">
                                  </path>
                                 
                                  <path name="WEB-INF/lib/guava-r05.jar">
                                     <exclude name="com.google.common.collect" />
                                  </path>
                                </scanning>
                                
                                

                                 

                                And the problem doesn't reproduce anymore. BTW, can you please add information about custom metadata files placement to the wiki?

                                • 14. Re: Cannot deploy application containing google guava
                                  Marcel Kolsteren Apprentice

                                  The problem with the inner class AbstractMultimap$WrappedList$WrappedListIterator can be reproduced with a simple program that calls getTypeParameters on all inner classes of Guava's AbstractMultimap class:

                                   

                                  package com.google.common.collect;


                                  public class Main

                                  {

                                     public static void main(String[] args)

                                     {

                                        for (Class<?> clazz : AbstractMultimap.class.getDeclaredClasses())

                                        {

                                           for (Class<?> clazz1 : clazz.getDeclaredClasses())

                                           {

                                              System.out.println(clazz1.getName());

                                              System.out.println(clazz1.getTypeParameters());

                                           }

                                        }

                                     }

                                  }

                                   

                                  To me this looks like a bug in the reflection code of the JVM (I used Sun's JVM 1.6 for Mac OS). I attached the Maven project for the program.

                                   

                                  Maybe the scanner should just ignore all classes that throw a GenericSignatureFormatError when getTypeParameters() is called? That's what I did by modifying scanning-deployers-jboss-beans (see my earlier post).

                                  1 2 Previous Next