6 Replies Latest reply on Dec 12, 2010 12:28 PM by jaikiran pai

    @DependsOn and @Singleton Bean in EJB3.1 using jboss 6.0 CR1

    aravind kopparthi Newbie

      I am not sure about the usage but i could not use it like this( @Singleton(DependsOn="SomeSingletonBean") i get compilation error  and also tried to use @DepdendsOn after @Singleton declaration.

      when i use

      @Singleton

      @DependsOn(SingletonProcessBean2)

      publilc class SingletonProcessBean1

      {

      ///

      }

      I get the following error. please advice.

       

      Deployment "<UNKNOWN jboss.j2ee:jar=javaee6-app.war,name=BobWireFTPProcessBean,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.j2ee:jar=javaee6-app.war,name=FtpServerPojo,service=EJB3' **, ** UNRESOLVED Demands 'jndi:FtpServerPojo/no-interface' **
        Deployment "jndi:BobWireFTPProcessBean/no-interface" is in error due to the following reason(s): ** NOT FOUND Depends on 'jndi:BobWireFTPProcessBean/no-interface' **
      at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.Alpha8]
      at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.Alpha8]
      at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.20101110-CR1]
      at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:118) [:0.1.0.Alpha1]
      at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:133) [:6.0.0.20101110-CR1]
      at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.20101110-CR1]
      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_13]

      Deployment "<UNKNOWN jboss.j2ee:jar=javaee6-app.war,name=SingletonProcessBean1,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.j2ee:jar=javaee6-app.war,name=SingletonProcessBean2,service=EJB3' **, ** UNRESOLVED Demands 'jndi:SingletonProcessBean2/no-interface' **

        Deployment "jndi:SingletonProcessBean1/no-interface" is in error due to the following reason(s): ** NOT FOUND Depends on 'jndi:SingletonProcessBean2/no-interface' **

       

      at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.Alpha8]

      at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.Alpha8]

      at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.20101110-CR1]

      at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:118) [:0.1.0.Alpha1]

      at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:133) [:6.0.0.20101110-CR1]

      at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.20101110-CR1]

      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_13]

        • 1. Re: @DependsOn and @Singleton Bean in EJB3.1 using jboss 6.0 CR1
          jaikiran pai Master

          aravind kopparthi wrote:

           

          I am not sure about the usage

          The EJB3.1 spec, section 4.8.1 has the details.

           

          aravind kopparthi wrote:

           

          but i could not use it like this( @Singleton(DependsOn="SomeSingletonBean") i get compilation error 

          That's not how it's supposed to be used. The correct way is:

           

          @Singleton
          @DependsOn("OtherSingletonBeanName")
          public class SingletonOne
          {
          .....
          

           

           

          aravind kopparthi wrote:

           

           

          when i use

          @Singleton

          @DependsOn(SingletonProcessBean2)

          publilc class SingletonProcessBean1

          {

          ///

          }

          I get the following error. please advice.

           

           

          Deployment "<UNKNOWN jboss.j2ee:jar=javaee6-app.war,name=BobWireFTPProcessBean,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.j2ee:jar=javaee6-app.war,name=FtpServerPojo,service=EJB3' **, ** UNRESOLVED Demands 'jndi:FtpServerPojo/no-interface' **
            Deployment "jndi:BobWireFTPProcessBean/no-interface" is in error due to the following reason(s): ** NOT FOUND Depends on 'jndi:BobWireFTPProcessBean/no-interface' **
          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.Alpha8]
          at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.Alpha8]
          at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.20101110-CR1]
          at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:118) [:0.1.0.Alpha1]
          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:133) [:6.0.0.20101110-CR1]
          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.20101110-CR1]
          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_13]

          Deployment "<UNKNOWN jboss.j2ee:jar=javaee6-app.war,name=SingletonProcessBean1,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.j2ee:jar=javaee6-app.war,name=SingletonProcessBean2,service=EJB3' **, ** UNRESOLVED Demands 'jndi:SingletonProcessBean2/no-interface' **

            Deployment "jndi:SingletonProcessBean1/no-interface" is in error due to the following reason(s): ** NOT FOUND Depends on 'jndi:SingletonProcessBean2/no-interface' **

           

          I assume that the code is just a pseudo code since it's not going to compile. What does the SingletonProcessBean2 look like? Please post the real code of both SingletonProcessBean1 and SingletonProcessBean2. Also please post the console logs that you see when you start deploying your application.

          • 2. Re: @DependsOn and @Singleton Bean in EJB3.1 using jboss 6.0 CR1
            aravind kopparthi Newbie

            @Singleton

            @DependsOn("SingletonProcessBean2")

            publilc class SingletonProcessBean1

            {

                    @PostConstruct

                      public void init(){

                              // trying to connect to the service that has been initialized in SingletonProcessBean2's PostConstruct

                      }

             

            }

             

            @Singleton

            publilc class SingletonProcessBean2{

             

             

                 @PostConstruct

                 public void init()

               {

                      //initialize Service;

               }

            }

            • 3. Re: @DependsOn and @Singleton Bean in EJB3.1 using jboss 6.0 CR1
              jaikiran pai Master

              Are they part of the same jar? If you have a simple failing deployment, then please create EJBTHREE JIRA and attach the application there. By the way, there have been changes in this area after 6.0 CR1 was released, so it might have been fixed in trunk. But it's better to get to the root of the issue.

              • 4. Re: @DependsOn and @Singleton Bean in EJB3.1 using jboss 6.0 CR1
                aravind kopparthi Newbie

                thanks i will do that, i will try testing on trunk version or wait till next week for the final release. .

                • 5. Re: @DependsOn and @Singleton Bean in EJB3.1 using jboss 6.0 CR1
                  aravind kopparthi Newbie

                  i don't see any create new issue link in here. could you please assist me in create a JIRA

                  https://issues.jboss.org/browse/EJBTHREE/

                  • 6. Re: @DependsOn and @Singleton Bean in EJB3.1 using jboss 6.0 CR1
                    jaikiran pai Master

                    You'll have to login to JIRA first. And once you are logged in, there's a "Create Issue" link/icon on the top right hand corner of the page here https://issues.jboss.org/browse/EJBTHREE