4 Replies Latest reply on Sep 4, 2010 4:46 AM by jaikiran

    @Singleton problem in jboss AS 6.0 M4

    sadsummer

      I hava build two ejb projects, each of them has a Singleton Bean,

      one deployed ok, but the other gives the follow error:

       

      Deployment "jboss.j2ee:jar=Test.jar,name=TestBean2,service=EJB3" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.j2ee:jar=Test.jar,name=TestBean2,service=EJB3' **

       

      Test is the name of one project, both Singleton Bean looks like below, so what the error means and  what' s the reason?

       

      @Singleton
      public class TestBean1 {

       

      }

       

      @Singleton
      public class TestBean2 {

       

      }

        • 1. Re: @Singleton problem in jboss AS 6.0 M4
          jaikiran

          Please post the entire exception stacktrace (or the relevant console log from the time your application is being deployed). Also please post the exact bean code - I'm assuming that the code you posted was just an example, although both are valid beans.

          • 2. Re: @Singleton problem in jboss AS 6.0 M4
            sadsummer

            the definition of singleton bean is just like this:

            @Singleton
            public class TestBean1 {

             

            }

             

            @Singleton
            public class TestBean2 {

             

            }

            TestBean1 is included in project 'Test1', the other is in 'Test2', there are no other codes in these two beans, but there are some other stateless session beans in both projects.

            for TestBean1, it is deployed like this:

            16:11:50,062 INFO  [SessionSpecContainer] Starting jboss.j2ee:jar=Test1.jar,name=TestBean1,service=EJB3
            16:11:50,062 INFO  [EJBContainer] STARTED EJB: com.test.TestBean1 ejbName: TestBean1

             

            TestBean2 with errors below, all other session beans are deployed, except it.

             

            DEPLOYMENTS MISSING DEPENDENCIES:

             

              Deployment "jboss.j2ee:jar=Test2.jar,name=TestBean2,service=EJB3_endpoint" is missing the following dependencies:
                Dependency "jboss.j2ee:jar=Test2.jar,name=TestBean2,service=EJB3" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.j2ee:jar=Test2.jar,name=TestBean2,service=EJB3' **")

             

            DEPLOYMENTS IN ERROR:
              Deployment "jboss.j2ee:jar=Test2.jar,name=TestBean2,service=EJB3" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.j2ee:jar=Test2.jar,name=TestBean2,service=EJB3' **

                at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.Alpha6]
                at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.Alpha6]
                at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.20100721-M4]
                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.20100721-M4]
                at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.20100721-M4]
                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]

            • 3. Re: @Singleton problem in jboss AS 6.0 M4
              sadsummer

              got the reason.

               

              under the Test2.jar/META-INF, there is a ejb-jar.xml, if I delete it, the singleton bean TestBean2 is deployed.

               

              but still no idea about the relationship between  singleton bean  and ejb-jar.xml

               

              this file is as follows:

              <?xml version="1.0" encoding="UTF-8"  ?>
                <display-name>test</display-name>
                </ejb-jar>

              • 4. Re: @Singleton problem in jboss AS 6.0 M4
                jaikiran

                Singleton beans are for EJB3.1. So the xsd you use in the ejb-jar.xml should be the ejb-jar_3_1.xsd and version = 3.1.

                 

                I however don't see why the exception is being thrown, unless ofcourse some other bean depends on Test2. I would have expected the Test2 bean to be completely skipped.