3 Replies Latest reply on Aug 21, 2010 12:39 PM by jaikiran

    @Singleton on JBoss AS 6.0.0.M4 failing to register in .ear file

    genman

      @Singleton and its like work in .war deployments, and I've been happily testing in Arquillian, but in an .ear package they DO show up in JNDI, but DO NOT show up under jboss.j2ee: (in the JMX console).

       

      For example:

       

      jboss.j2ee


          * ear=geoserver.ear,jar=llejb-1.0.0.0-SNAPSHOT.jar,name=ClientManagerEJB,service=EJB3
          * ear=geoserver.ear,jar=llejb-1.0.0.0-SNAPSHOT.jar,name=ContentManagerEJB,service=EJB3

      ...

       

      But under JNDI you see the singletons here (and not the @Stateless beans). The @Stateless beans fail to register regardless if the @EJB depends on the singletons.

       

        +- geoserver (class: org.jnp.interfaces.NamingContext)
        |   +- LLCacheManagerEJB (class: org.jnp.interfaces.NamingContext)
        |   |   +- remote-com.autodesk.lbs.afx.llcachemanager.LLCacheManager (proxy: $Proxy174 implements interface com.autodesk.lbs.afx.llcachemanager.LLCacheManager)
        |   |   +- remote (proxy: $Proxy174 implements interface com.autodesk.lbs.afx.llcachemanager.LLCacheManager)
        |   +- PropertyAccessEJB (class: org.jnp.interfaces.NamingContext)
        |   |   +- remote-com.autodesk.lbs.gis.naming.PropertyAccess (proxy: $Proxy177 implements interface com.autodesk.lbs.gis.naming.PropertyAccess)
        |   |   +- remote (proxy: $Proxy177 implements interface com.autodesk.lbs.gis.naming.PropertyAccess)

      The logs are:

       

      << Bunch of @Stateless beans logged like:

      INFO [JBossASKernel] Added bean(jboss.j2ee:ear=geoserver.ear,jar=llejb-1.0.0.0-SNAPSHOT.jar,name=SubscriptionManagerMDB,service=EJB3) to KernelDeployment of: llejb-1.0.0.0-SNAPSHOT.jar
      INFO [JBossASKernel] installing bean: jboss.j2ee:ear=geoserver.ear,jar=llejb-1.0.0.0-SNAPSHOT.jar,name=SubscriptionManagerEJB,service=EJB3
      INFO [JBossASKernel]   with dependencies:
      INFO [JBossASKernel]   and demands:
      ...

      INFO [JBossASKernel]   and supplies:

      >>

      ...

      INFO [SessionSpecContainer] Starting jboss.j2ee:ear=geoserver.ear,jar=llejb-1.0.0.0-SNAPSHOT.jar,name=PropertyAccessBean,service=EJB3
      INFO [EJBContainer] STARTED EJB: com.autodesk.lbs.gis.naming.PropertyAccessBean ejbName: PropertyAccessBean
      INFO [SessionSpecContainer] Starting jboss.j2ee:ear=geoserver.ear,jar=llejb-1.0.0.0-SNAPSHOT.jar,name=LLCacheManagerEJB,service=EJB3
      INFO [EJBContainer] STARTED EJB: com.autodesk.lbs.afx.llcachemanager.LLCacheManagerEJB ejbName: LLCacheManagerEJB

       

      Oddly enough, the @Singleton aren't listed with demands/dependencies.

       

      The error is then:


      WARN [MainDeployer] Failed to deploy: file:/C:/dev/workspace/geoserver/deployment/target/geoserver.ear: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

       

      DEPLOYMENTS MISSING DEPENDENCIES:

      Deployment "jboss.ejb3:application=geoserver,module=llejb-1.0.0.0-SNAPSHOT,component=SubscriptionManagerEJB,service=EjbEncFactory" is missing the following dependencies:
          Dependency "jboss.naming:application=geoserver,component=SubscriptionManagerEJB,module=llejb-1.0.0.0-SNAPSHOT" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.naming:application=geoserver,component=SubscriptionManagerEJB,module=llejb-1.0.0.0-SNAPSHOT' **")
        Deployment "jboss.ejb3:application=geoserver,module=llejb-1.0.0.0-SNAPSHOT,component=SubscriptionManagerMDB,service=EjbEncFactory" is missing the following dependencies:
          Dependency "jboss.naming:application=geoserver,component=SubscriptionManagerMDB,module=llejb-1.0.0.0-SNAPSHOT" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.naming:application=geoserver,component=SubscriptionManagerMDB,module=llejb-1.0.0.0-SNAPSHOT' **")

       

      Couple of thoughts/questions...

       

      How does JBoss treat a @Singleton EJB differently, in the context of .ear versus .war packaging? How does JBoss detect a 3.1 versus 3.0 deployment?

       

      Also, is there some way JBoss detects a 3.1 deploymentversus 3.0, in the class org.jboss.metadata.ejb.jboss.JBossMetaData ? Does it matter in this case?

        • 1. Re: @Singleton on JBoss AS 6.0.0.M4 failing to register in .ear file
          jaikiran

          Elias Ross wrote:

           

          @Singleton and its like work in .war deployments, and I've been happily testing in Arquillian, but in an .ear package they DO show up in JNDI, but DO NOT show up under jboss.j2ee: (in the JMX console).

           

          For example:

           

          jboss.j2ee

           

              * ear=geoserver.ear,jar=llejb-1.0.0.0-SNAPSHOT.jar,name=ClientManagerEJB,service=EJB3
              * ear=geoserver.ear,jar=llejb-1.0.0.0-SNAPSHOT.jar,name=ContentManagerEJB,service=EJB3

          ...

          I'll check whether or not we are registering them in MBeanServer. By the way, does the absence of those MBeans for Singleton beans affect any functionality?

           

          Elias Ross wrote:

           

          But under JNDI you see the singletons here (and not the @Stateless beans). The @Stateless beans fail to register regardless if the @EJB depends on the singletons.

           

            +- geoserver (class: org.jnp.interfaces.NamingContext)
            |   +- LLCacheManagerEJB (class: org.jnp.interfaces.NamingContext)
            |   |   +- remote-com.autodesk.lbs.afx.llcachemanager.LLCacheManager (proxy: $Proxy174 implements interface com.autodesk.lbs.afx.llcachemanager.LLCacheManager)
            |   |   +- remote (proxy: $Proxy174 implements interface com.autodesk.lbs.afx.llcachemanager.LLCacheManager)
            |   +- PropertyAccessEJB (class: org.jnp.interfaces.NamingContext)
            |   |   +- remote-com.autodesk.lbs.gis.naming.PropertyAccess (proxy: $Proxy177 implements interface com.autodesk.lbs.gis.naming.PropertyAccess)
            |   |   +- remote (proxy: $Proxy177 implements interface com.autodesk.lbs.gis.naming.PropertyAccess)

          The logs are:

           

          << Bunch of @Stateless beans logged like:

          INFO [JBossASKernel] Added bean(jboss.j2ee:ear=geoserver.ear,jar=llejb-1.0.0.0-SNAPSHOT.jar,name=SubscriptionManagerMDB,service=EJB3) to KernelDeployment of: llejb-1.0.0.0-SNAPSHOT.jar
          INFO [JBossASKernel] installing bean: jboss.j2ee:ear=geoserver.ear,jar=llejb-1.0.0.0-SNAPSHOT.jar,name=SubscriptionManagerEJB,service=EJB3
          INFO [JBossASKernel]   with dependencies:
          INFO [JBossASKernel]   and demands:
          ...

          INFO [JBossASKernel]   and supplies:

          >>

          ...


           

          Oddly enough, the @Singleton aren't listed with demands/dependencies.

          Can you please post the @Stateless bean code and the relevant @Singleton code? Also where exactly in the .ear is that singleton bean packaged? By the way, the name of that bean looks strange "SubscriptionManagerMDB" - is that an MDB or a SLSB?

           

          Elias Ross wrote:

           


           

          The error is then:


          WARN [MainDeployer] Failed to deploy: file:/C:/dev/workspace/geoserver/deployment/target/geoserver.ear: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

           

          DEPLOYMENTS MISSING DEPENDENCIES:

          Deployment "jboss.ejb3:application=geoserver,module=llejb-1.0.0.0-SNAPSHOT,component=SubscriptionManagerEJB,service=EjbEncFactory" is missing the following dependencies:
              Dependency "jboss.naming:application=geoserver,component=SubscriptionManagerEJB,module=llejb-1.0.0.0-SNAPSHOT" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.naming:application=geoserver,component=SubscriptionManagerEJB,module=llejb-1.0.0.0-SNAPSHOT' **")
            Deployment "jboss.ejb3:application=geoserver,module=llejb-1.0.0.0-SNAPSHOT,component=SubscriptionManagerMDB,service=EjbEncFactory" is missing the following dependencies:
              Dependency "jboss.naming:application=geoserver,component=SubscriptionManagerMDB,module=llejb-1.0.0.0-SNAPSHOT" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.naming:application=geoserver,component=SubscriptionManagerMDB,module=llejb-1.0.0.0-SNAPSHOT' **")

           

          Hmm, the more I try to understand that log message, the more confused I am. But the MC error reporting is a known issue. So I'll ignore that error message for now.

           

          Elias Ross wrote:

           


          Couple of thoughts/questions...

           

          How does JBoss treat a @Singleton EJB differently, in the context of .ear versus .war packaging?


          It shouldn't really matter whether it's packaged in .ear or .war. But I'm not really sure what you mean by packaging in .ear. I'm guessing you are packaging the EJBs in a .jar and placing in the .ear. The exact location and details of that jar will help.

           

          Elias Ross wrote:

           

          How does JBoss detect a 3.1 versus 3.0 deployment?

           

          For a deployment descriptor based deployment, the xsd version specified in ejb-jar.xml is the deciding factor. It's the version attribute value in that xsd declaration that's important. For a purely annotation based deployment, in AS6, the deployment is considered an EJB3.1 deployment (irrespective of whether it contains any EJB3.1 specific features).

           

          Elias Ross wrote:

           

          Also, is there some way JBoss detects a 3.1 deploymentversus 3.0, in the class org.jboss.metadata.ejb.jboss.JBossMetaData ? Does it matter in this case?

           

          Yes it does. The deployment process involves merging the annotation view and the deployment descriptor view of the deployment into a JBossMetaData instance for that deployment. And that's the instance we use to mark the deployment as 3.1 or 3.0 (or for that matter any other version) and that instance is what drives the creation of appropriate containers for the beans.

          1 of 1 people found this helpful
          • 2. Re: @Singleton on JBoss AS 6.0.0.M4 failing to register in .ear file
            genman

            Can't seem to quote ...

             

            MBean registration isn't important. But it's definitely odd.

             

            The code's in a .jar in an .ear file for a proprietary application I was porting from EJB 2.

             

            Let me get back to you. I'm off on vacation for a few weeks. (I'd be happy to PM you the .ear file and source later.)

            • 3. Re: @Singleton on JBoss AS 6.0.0.M4 failing to register in .ear file
              jaikiran

              Elias Ross wrote:

               

              (I'd be happy to PM you the .ear file and source later.)

              Sure.