2 Replies Latest reply on Jul 16, 2008 8:06 AM by lynchie

    Annotation Scanning in AS5

    lynchie Newbie

      I've just migrated an ear from 4.2.2 to 5. One thing I've noticed is it now takes 6 extra minutes to start up.
      It looks as if most of the time is spent scanning for annotations inside my war. My war contains several 3rd party jars such as apache-commons, spring, struts etc..
      Is there a way to disable scanning in certain jar files, preferably to disable scanning in WEB-INF/lib but still scan WEB-INF/classes?

        • 1. Re: Annotation Scanning in AS5
          Ales Justin Master

          The annotation scanning is done in org.jboss.deployment.AnnotationMetaDataDeployer.

          Looking at it, I don't see any useful existing hooks.
          But you can always override the class, in this case its getClasses method, excluding the classpaths you don't want checked.

          I wrote and alternative to that AMDdeployer, AltAMDDeployer.
          See metadata-deployer-beans.xml, currenty it's commented.

          But this is an issue we're currently optimizing:
          - http://lists.jboss.org/pipermail/jboss-development/2008-July/012304.html

          And I'll try to make (class)path exclusion more flexible.

          • 2. Re: Annotation Scanning in AS5
            lynchie Newbie

            Thanks for the reply. I'm gonna look into overriding the class, but im sure a better solution would be a jboss specific xml file that you could specify a filter list or a list of jar's to exclude.

            Anyway, I tried your Alt version of the deployer. Its definitely quicker at the scanning but using it caused an exception when deploying the ejb3 modules. Had a quick search but cant find anybody else with a similar issue. Everything deploys fine when using the original Metadata deployer (although slower!) Not sure if this issue has been identified before and fixed in svn but not inlcluded in CR1


            2008-07-16 12:49:03,187 DEBUG [org.jboss.ejb3.deployers.Ejb3Deployer] (main) ********* Ejb3Deployer Begin Unit: testapp-mgr-ejb3-1.0.jar jar: testapp-mgr-ejb3-1.0.jar
            2008-07-16 12:49:03,296 INFO [STDOUT] (main) ======> Creating interceptor metadata bridge
            2008-07-16 12:49:03,328 DEBUG [org.jboss.ejb3.Ejb3Deployment] (main) error trying to stop ejb deployment
            javax.management.RuntimeOperationsException
            at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:515)
            at org.jboss.mx.server.MBeanServerImpl.unregisterMBean(MBeanServerImpl.java:383)
            at org.jboss.ejb3.Ejb3Deployment.unregisterDeployment(Ejb3Deployment.java:414)
            at org.jboss.ejb3.Ejb3Deployment.destroy(Ejb3Deployment.java:765)
            at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:477)
            at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:178)
            at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:95)
            at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
            at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
            at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:174)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:970)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1023)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:911)
            at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
            at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:672)
            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:455)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:594)
            at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
            at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:257)
            at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:135)
            at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:409)
            at org.jboss.Main.boot(Main.java:209)
            at org.jboss.Main$1.run(Main.java:544)
            at java.lang.Thread.run(Thread.java:619)
            Caused by: java.lang.IllegalArgumentException: null object name
            ... 28 more
            2008-07-16 12:49:03,328 DEBUG [org.jboss.ejb3.deployers.Ejb3Deployer] (main) Error during deploy: vfszip:/c:/temp/jboss-5.0.0.CR1/server/default/deploy/testapp.ear/testapp-mgr-ejb3-1.0.jar
            org.jboss.deployers.spi.DeploymentException: Error deploying testapp-mgr-ejb3-1.0.jar: failed to initialize bean container
            at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:192)
            at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:95)
            at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
            at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
            at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:174)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:970)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1023)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:911)
            at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
            at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:672)
            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:455)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:594)
            at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
            at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:257)
            at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:135)
            at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:409)
            at org.jboss.Main.boot(Main.java:209)
            at org.jboss.Main$1.run(Main.java:544)
            at java.lang.Thread.run(Thread.java:619)
            Caused by: java.lang.RuntimeException: failed to initialize bean container
            at org.jboss.ejb3.EJBContainer.<init>(EJBContainer.java:225)
            at org.jboss.ejb3.session.SessionContainer.<init>(SessionContainer.java:116)
            at org.jboss.ejb3.session.SessionSpecContainer.<init>(SessionSpecContainer.java:29)
            at org.jboss.ejb3.stateless.StatelessContainer.<init>(StatelessContainer.java:89)
            at org.jboss.ejb3.Ejb3AnnotationHandler.getStatelessContainer(Ejb3AnnotationHandler.java:310)
            at org.jboss.ejb3.Ejb3AnnotationHandler.getContainers(Ejb3AnnotationHandler.java:203)
            at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:645)
            at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:605)
            at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:587)
            at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:553)
            at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:465)
            at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:178)
            ... 22 more
            Caused by: java.lang.IllegalStateException: Null beannMetaData
            at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.setupMetaDataLists(BeanInterceptorMetaDataBridge.java:262)
            at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.initialise(BeanInterceptorMetaDataBridge.java:187)
            at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.<init>(BeanInterceptorMetaDataBridge.java:113)
            at org.jboss.ejb3.interceptors.metadata.AdditiveBeanInterceptorMetaDataBridge.<init>(AdditiveBeanInterceptorMetaDataBridge.java:48)
            at org.jboss.ejb3.aop.BeanContainer.initialize(BeanContainer.java:194)
            at org.jboss.ejb3.EJBContainer.<init>(EJBContainer.java:221)
            ... 33 more
            Caused by: java.lang.NullPointerException
            at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.setupMetaDataLists(BeanInterceptorMetaDataBridge.java:215)
            ... 38 more
            2008-07-16 12:49:03,328 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Real: name=vfsfile:/c:/temp/jboss-5.0.0.CR1/server/default/deploy/testapp.ear/ state=PreReal mode=Manual requiredState=Real
            org.jboss.deployers.spi.DeploymentException: Error deploying testapp-mgr-ejb3-1.0.jar: failed to initialize bean container
            at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:192)
            at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:95)
            at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
            at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
            at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:174)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:970)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1023)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:911)
            at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
            at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:672)
            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:455)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:594)
            at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
            at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:257)
            at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:135)
            at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:409)
            at org.jboss.Main.boot(Main.java:209)
            at org.jboss.Main$1.run(Main.java:544)
            at java.lang.Thread.run(Thread.java:619)
            Caused by: java.lang.RuntimeException: failed to initialize bean container
            at org.jboss.ejb3.EJBContainer.<init>(EJBContainer.java:225)
            at org.jboss.ejb3.session.SessionContainer.<init>(SessionContainer.java:116)
            at org.jboss.ejb3.session.SessionSpecContainer.<init>(SessionSpecContainer.java:29)
            at org.jboss.ejb3.stateless.StatelessContainer.<init>(StatelessContainer.java:89)
            at org.jboss.ejb3.Ejb3AnnotationHandler.getStatelessContainer(Ejb3AnnotationHandler.java:310)
            at org.jboss.ejb3.Ejb3AnnotationHandler.getContainers(Ejb3AnnotationHandler.java:203)
            at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:645)
            at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:605)
            at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:587)
            at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:553)
            at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:465)
            at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:178)
            ... 22 more
            Caused by: java.lang.IllegalStateException: Null beannMetaData
            at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.setupMetaDataLists(BeanInterceptorMetaDataBridge.java:262)
            at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.initialise(BeanInterceptorMetaDataBridge.java:187)
            at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.<init>(BeanInterceptorMetaDataBridge.java:113)
            at org.jboss.ejb3.interceptors.metadata.AdditiveBeanInterceptorMetaDataBridge.<init>(AdditiveBeanInterceptorMetaDataBridge.java:48)
            at org.jboss.ejb3.aop.BeanContainer.initialize(BeanContainer.java:194)
            at org.jboss.ejb3.EJBContainer.<init>(EJBContainer.java:221)
            ... 33 more
            Caused by: java.lang.NullPointerException
            at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.setupMetaDataLists(BeanInterceptorMetaDataBridge.java:215)
            ... 38 more