3 Replies Latest reply: Apr 23, 2010 6:35 PM by Pasta Farian RSS

    java.lang.IllegalStateException: Should not have null domainName for scoped bean

    Pasta Farian Newbie

      I have an EAR file that contains  multiple WAR files. I added an AOP interceptor to one of the war files  and I get the following error when trying to deploy the wAR file. The  EAR file deploys fine only if I remove the jboss-aop.xml from the META-INF directory of the offending WAR file.  Any ideas? I'm using JBoss 5.1, JDK 1.6 and JBoss AOP 2.1.8.GA

       

      org.jboss.deployers.spi.DeploymentException:  Error during deploy:  vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/myEAR.ear/myWAR.war/
               at  org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
               at  org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177)
               at  org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
               at  org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
               at  org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
               at  org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
               at  org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
               at  org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
               at  org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
               at  org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
               at  org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
               at  org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
               at  org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
               at  org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
               at  org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
               at  org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
               at  org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
               at  org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
               at  org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
               at  org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
               at  org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
               at  org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
               at  org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
               at  org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
               at  org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
               at  org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
               at  org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
               at  org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
               at  org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
               at org.jboss.Main.boot(Main.java:221)
              at  org.jboss.Main$1.run(Main.java:556)
              at  java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.IllegalStateException: Should not have null  domainName for scoped bean
              at  org.jboss.aop.asintegration.jboss5.AopMetaDataDeployerOutput.setScopedInformation(AopMetaDataDeployerOutput.java:77)
               at  org.jboss.aop.asintegration.jboss5.AbstractAopMetaDataDeployer.massageScopedDeployment(AbstractAopMetaDataDeployer.java:239)
               at  org.jboss.aop.asintegration.jboss5.AbstractAopMetaDataDeployer.deploy(AbstractAopMetaDataDeployer.java:127)
               at  org.jboss.aop.asintegration.jboss5.AOPDeploymentAopMetaDataDeployer.deploy(AOPDeploymentAopMetaDataDeployer.java:46)
               at  org.jboss.aop.asintegration.jboss5.AOPDeploymentAopMetaDataDeployer.deploy(AOPDeploymentAopMetaDataDeployer.java:36)
               at  org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer.deploy(AbstractSimpleVFSRealDeployer.java:56)
               at  org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
               at  org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
               at  org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
               ... 30 more

        • 1. Re: java.lang.IllegalStateException: Should not have null domainName for scoped bean
          Pasta Farian Newbie

          More information...

           

          Here is my jboss-aop.xml which is placed in the META-INF directory of the war file. The war file is one of several independent war files in the EAR file.

           

          <aop xmlns="urn:jboss:aop-beans:1.0">
              <interceptor/>
              <bind pointcut="execution(* com.acme.*->*(..))">
                  <interceptor-ref name="com.intuit.loghub.aop.LogInterceptor"/>
              </bind>

           

          </aop>

           

          I tried putting a <domain name="TestDomain> element around the <bind> element but I still got the same exception above.

           

          I found a mention of Domain in the EJB3 Customized deployment docs: http://www.jboss.org/ejb3/docs/tutorial/configuration/configuration.html


          Domains

          The <domain ... /> elements configure the server side. There is a  default domain for each bean type. This is where the server side interceptor chains are defined using the AOP Pointcut Language  (i.e. <bind pointcut="..." />). Please see the AOP documentation for more information on the Pointcut Language. The Domains  are also used to introduce default annotations and thus create default behavior for each of the bean types. For example, take a  look at the "Stateless Bean" domain. Notice that through the <annotation expr="..." /> element, a default  @org.jboss.annotation.ejb.PoolClass is created for each stateless  session bean that does not explicitly define a @org.jboss.annotation.ejb.PoolClass  annotation on the class.

           

           

          Except the war file in question doesn't have any EJBs in it! It's just a resteasy servlet and supporting code.

          • 2. Re: java.lang.IllegalStateException: Should not have null domainName for scoped bean
            Flavia Rainone Master

            The domain that the error refers to is probably a ClassLoader domain, since the war deployment is scoped.

             

            Take a look at our injboss example to see what piece you are missing in your example.

            • 3. Re: java.lang.IllegalStateException: Should not have null domainName for scoped bean
              Pasta Farian Newbie

              Thanks Flavia.

               

              When I deploy the WAR by itself it deploys fine. When the WAR is deployed as part of an EAR file I get this exception. Each WAR in the EAR is a separate app and declares its own Classloader name.