11 Replies Latest reply on Sep 26, 2007 6:44 PM by Jeremy Norris

    Why cant JBoss 4.0.4 GA deploy these Beans?

    Javier Pedrido Newbie

      Hello,

      I have these beans, that deploy without problems in JBoss 4.0.3SP1, but fail to deploy in 4.0.4 GA.

      @Stateless
      public class EJB1Session implements EJB1 {
      
       @EJB private EJB2 ejb2;
      
       public void doSomething() {
       ejb2.doOtherthing();
       }
      
      }
      
      @Stateless
      public class EJB2Session implements EJB2 {
      
       @EJB private EJB1 ejb1;
      
       public void doSomething() {
       ejb1.doSomething();
       }
      
       public void doOtherthing() {
       System.out.println("EJB2Session.doOtherthing");;
       }
      
      }
      


      Is it a bug in Jboss 4.0.4 GA?

      Best regards,
      Javier


        • 2. Re: Why cant JBoss 4.0.4 GA deploy these Beans?
          Javier Pedrido Newbie

          Hi Bernard

          Fail means that the session beans are not being deployed. The following errors appears in the console


          17:07:17,609 INFO [EJB3Deployer] Deployed: file:/C:/temp/jboss-4.0.4.GAP1/serve
          r/default/deploy/test.jar
          17:07:17,640 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../dep
          loy/jmx-console.war/
          17:07:17,796 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

          --- MBeans waiting for other MBeans ---
          ObjectName: jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3
          State: NOTYETINSTALLED
          I Depend On:
          jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3
          Depends On Me:
          jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3

          ObjectName: jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3
          State: NOTYETINSTALLED
          I Depend On:
          jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3
          Depends On Me:
          jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3


          • 3. Re: Why cant JBoss 4.0.4 GA deploy these Beans?
            Emmanuel Bernard Master

            There sould be a cause somewhere in the logs

            • 4. Re: Why cant JBoss 4.0.4 GA deploy these Beans?
              Javier Pedrido Newbie

              This is the server.log content after deploying the bean


              2006-05-19 19:02:50,890 DEBUG [org.jboss.deployment.MainDeployer] Starting deployment (init step) of package at: file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar

              2006-05-19 19:02:50,890 DEBUG [org.jboss.deployment.MainDeployer] Copying file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar -> C:\temp\jboss-4.0.4.GAP1\server\default\tmp\deploy\tmp9476test.jar

              2006-05-19 19:02:50,921 DEBUG [org.jboss.deployment.MainDeployer] using deployer MBeanProxyExt[jboss.ejb3:service=EJB3Deployer]

              2006-05-19 19:02:50,921 DEBUG [org.jboss.ejb3.EJB3Deployer] looking for nested deployments in : file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar

              2006-05-19 19:02:50,921 DEBUG [org.jboss.deployment.DeploymentInfo] createLoaderRepository from config: LoaderRepositoryConfig(repositoryName: JMImplementation:service=LoaderRepository,name=Default, repositoryClassName: null, configParserClassName: null, repositoryConfig: null)

              2006-05-19 19:02:50,921 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.UnifiedLoaderRepository3@17ce4e7, cl=org.jboss.mx.loading.UnifiedClassLoader3@19478c7{ url=file:/C:/temp/jboss-4.0.4.GAP1/server/default/tmp/deploy/tmp9476test.jar ,addedOrder=0}

              2006-05-19 19:02:50,921 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.UnifiedLoaderRepository3@17ce4e7, cl=org.jboss.mx.loading.UnifiedClassLoader3@19478c7{ url=file:/C:/temp/jboss-4.0.4.GAP1/server/default/tmp/deploy/tmp9476test.jar ,addedOrder=0}

              2006-05-19 19:02:50,921 DEBUG [org.jboss.mx.loading.UnifiedLoaderRepository3] Adding org.jboss.mx.loading.UnifiedClassLoader3@19478c7{ url=file:/C:/temp/jboss-4.0.4.GAP1/server/default/tmp/deploy/tmp9476test.jar ,addedOrder=0}

              2006-05-19 19:02:50,921 DEBUG [org.jboss.deployment.MainDeployer] found 0 subpackages of file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar

              2006-05-19 19:02:50,921 DEBUG [org.jboss.deployment.MainDeployer] Watching new file: file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar

              2006-05-19 19:02:50,921 DEBUG [org.jboss.deployment.MainDeployer] create step for deployment file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar

              2006-05-19 19:02:50,921 DEBUG [org.jboss.ws.server.WebServiceDeployerEJB3] create: file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar

              2006-05-19 19:02:50,921 DEBUG [org.jboss.ejb3.EJB3Deployer] create, test.jar

              2006-05-19 19:02:50,968 DEBUG [org.jboss.ejb3.EJB3Deployer] Deploying: file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar

              2006-05-19 19:02:50,968 DEBUG [org.jboss.system.ServiceController] Creating service jboss.j2ee:service=EJB3,module=test.jar

              2006-05-19 19:02:50,968 DEBUG [org.jboss.ejb3.Ejb3Module] Creating jboss.j2ee:service=EJB3,module=test.jar

              2006-05-19 19:02:50,968 DEBUG [org.jboss.ejb3.security.JaccHelper] Initialising JACC Context for deployment: test.jar

              2006-05-19 19:02:51,093 DEBUG [org.jboss.ejb3.Ejb3AnnotationHandler] found EJB3: ejbName=EJB1Session, class=test.EJB1Session, type=STATELESS

              2006-05-19 19:02:51,109 DEBUG [org.jboss.ejb3.ProxyDeployer] no declared remote bindings for : EJB1Session

              2006-05-19 19:02:51,125 DEBUG [org.jboss.ejb3.Ejb3AnnotationHandler] found EJB3: ejbName=EJB2Session, class=test.EJB2Session, type=STATELESS

              2006-05-19 19:02:51,125 DEBUG [org.jboss.ejb3.ProxyDeployer] no declared remote bindings for : EJB2Session

              2006-05-19 19:02:51,125 INFO [org.jboss.ejb3.Ejb3Deployment] EJB3 deployment time took: 157

              2006-05-19 19:02:51,140 DEBUG [org.jboss.ejb3.Ejb3Module] Created jboss.j2ee:service=EJB3,module=test.jar

              2006-05-19 19:02:51,140 DEBUG [org.jboss.system.ServiceController] Creating dependent components for: jboss.j2ee:service=EJB3,module=test.jar dependents are: []

              2006-05-19 19:02:51,140 DEBUG [org.jboss.deployment.MainDeployer] Done with create step of deploying test.jar

              2006-05-19 19:02:51,140 DEBUG [org.jboss.deployment.MainDeployer] Begin deployment start file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar

              2006-05-19 19:02:51,140 DEBUG [org.jboss.ws.server.WebServiceDeployerEJB3] start: file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar

              2006-05-19 19:02:51,140 DEBUG [org.jboss.ejb3.EJB3Deployer] start application, deploymentInfo: org.jboss.deployment.DeploymentInfo@546f2062 { url=file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar }
              deployer: MBeanProxyExt[jboss.ejb3:service=EJB3Deployer]
              status: Starting
              state: START_DEPLOYER
              watch: file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar
              altDD: null
              lastDeployed: 1148076170921
              lastModified: 1148076170890
              mbeans:
              , short name: test.jar, parent short name: null

              2006-05-19 19:02:51,140 DEBUG [org.jboss.system.ServiceController] starting service jboss.j2ee:service=EJB3,module=test.jar

              2006-05-19 19:02:51,140 DEBUG [org.jboss.ejb3.Ejb3Module] Starting jboss.j2ee:service=EJB3,module=test.jar

              2006-05-19 19:02:51,531 DEBUG [org.jboss.ejb3.EJBContainer] Initialising interceptors for EJB1Session...

              2006-05-19 19:02:51,531 DEBUG [org.jboss.ejb3.EJBContainer] Default interceptors: null

              2006-05-19 19:02:51,531 DEBUG [org.jboss.ejb3.EJBContainer] Class interceptors: []

              2006-05-19 19:02:51,531 DEBUG [org.jboss.ejb3.EJBContainer] All applicable interceptor classes: []

              2006-05-19 19:02:51,531 DEBUG [org.jboss.ejb3.EJBContainer] Initialising interceptors for EJB2Session...

              2006-05-19 19:02:51,531 DEBUG [org.jboss.ejb3.EJBContainer] Default interceptors: null

              2006-05-19 19:02:51,531 DEBUG [org.jboss.ejb3.EJBContainer] Class interceptors: []

              2006-05-19 19:02:51,531 DEBUG [org.jboss.ejb3.EJBContainer] All applicable interceptor classes: []

              2006-05-19 19:02:51,531 DEBUG [org.jboss.ejb3.JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer

              2006-05-19 19:02:51,546 INFO [org.jboss.ejb3.JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3 with dependencies:

              2006-05-19 19:02:51,546 INFO [org.jboss.ejb3.JmxKernelAbstraction] jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] Creating service jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] adding depends in ServiceController.register: [jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3]

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] recording that jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3 depends on jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] waiting in create of jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3 waiting on jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] starting service jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] Start requested before create, calling create now for service: jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] Creating service jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] waiting in create of jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3 waiting on jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] waiting in start jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3 on jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.ejb3.Ejb3Deployment] Bound ejb3 container jboss.j2ee:service=EJB3,jar=test.jar,name=EJB1Session

              2006-05-19 19:02:51,546 DEBUG [org.jboss.ejb3.JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer

              2006-05-19 19:02:51,546 INFO [org.jboss.ejb3.JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3 with dependencies:

              2006-05-19 19:02:51,546 INFO [org.jboss.ejb3.JmxKernelAbstraction] jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] Creating service jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] adding depends in ServiceController.register: [jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3]

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] recording that jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3 depends on jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] waiting in create of jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3 waiting on jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] starting service jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] Start requested before create, calling create now for service: jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] Creating service jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] waiting in create of jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3 waiting on jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] waiting in start jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3 on jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3

              2006-05-19 19:02:51,546 DEBUG [org.jboss.ejb3.Ejb3Deployment] Bound ejb3 container jboss.j2ee:service=EJB3,jar=test.jar,name=EJB2Session

              2006-05-19 19:02:51,546 DEBUG [org.jboss.ejb3.security.JaccHelper] JACC Policy Configuration for deployment has been put in service

              2006-05-19 19:02:51,546 DEBUG [org.jboss.ejb3.Ejb3Module] Started jboss.j2ee:service=EJB3,module=test.jar

              2006-05-19 19:02:51,546 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss.j2ee:service=EJB3,module=test.jar dependent components: []

              2006-05-19 19:02:51,546 INFO [org.jboss.ejb3.EJB3Deployer] Deployed: file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar

              2006-05-19 19:02:51,546 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: test.jar

              2006-05-19 19:02:51,546 DEBUG [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar

              2006-05-19 19:02:51,546 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Watch URL for: file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar -> file:/C:/temp/jboss-4.0.4.GAP1/server/default/deploy/test.jar

              2006-05-19 19:02:51,546 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] Incomplete Deployment listing:

              --- MBeans waiting for other MBeans ---
              ObjectName: jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3
              State: NOTYETINSTALLED
              I Depend On:
              jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3
              Depends On Me:
              jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3

              ObjectName: jboss.j2ee:jar=test.jar,name=EJB2Session,service=EJB3
              State: NOTYETINSTALLED
              I Depend On:
              jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3
              Depends On Me:
              jboss.j2ee:jar=test.jar,name=EJB1Session,service=EJB3


              • 5. Re: Why cant JBoss 4.0.4 GA deploy these Beans?
                Javier Pedrido Newbie

                The same Jar can be deployed in GlassFish and it works OK. I can send you the Jar if you want.

                Best regards,
                Javier

                • 7. Re: Why cant JBoss 4.0.4 GA deploy these Beans?
                  Javier Pedrido Newbie

                  I've created the issue in jira
                  http://jira.jboss.com/jira/browse/EJBTHREE-583

                  I hope you can fix this bug in EJB3 RC7.

                  Thanks,
                  Javier

                  • 8. Re: Why cant JBoss 4.0.4 GA deploy these Beans?
                    William DeCoste Apprentice

                    There is a circular dependency, which is not allowed. EJB1Session is dependent on EJB2Session and EJB2Session is dependent on EJB1Session. So neither can be deployed, since they are each waiting for the deployment of the other to handle the injection.

                    I will close the JIRA issue.

                    • 9. Re: Why cant JBoss 4.0.4 GA deploy these Beans?
                      Bill Burke Master

                      You can break the circular dependency by adding the @IgnoreDependency annotation to the injected @EJB

                      @Stateless
                      public class MyBean implements ... {
                      
                       @EJB
                       @IgnoreDependency
                       private AnotherEJB another;
                      
                      }
                      
                      


                      Or use the XML version.

                      <jboss>
                       <enterprise-beans>
                       <session>
                       <ejb-name>Session1Bean</ejb-name>
                       <ejb-ref>
                       <ejb-ref-name>session2</ejb-ref-name>
                       <ignore-dependency/>
                       </ejb-ref>
                       </session>
                       </enterprise-beans>
                      </jboss>
                      
                      



                      • 10. Re: Why cant JBoss 4.0.4 GA deploy these Beans?
                        Javier Pedrido Newbie

                        Thanks for the help Bill, I will use the ingnore deps annotation. I didn't know it existed

                        • 11. Re: Why cant JBoss 4.0.4 GA deploy these Beans?
                          Jeremy Norris Newbie

                           

                          "bill.burke@jboss.com" wrote:
                          You can break the circular dependency by adding the @IgnoreDependency annotation to the injected @EJB

                          @Stateless
                          public class MyBean implements ... {
                          
                           @EJB
                           @IgnoreDependency
                           private AnotherEJB another;
                          
                          }
                          
                          


                          Or use the XML version.

                          <jboss>
                           <enterprise-beans>
                           <session>
                           <ejb-name>Session1Bean</ejb-name>
                           <ejb-ref>
                           <ejb-ref-name>session2</ejb-ref-name>
                           <ignore-dependency/>
                           </ejb-ref>
                           </session>
                           </enterprise-beans>
                          </jboss>
                          
                          



                          The EJB3 spec doesn't seem to have anything to say about this. I have a few circular dependencies in my code (for which the JBoss solution of @IgnoreDependency works really well) but I am wondering should they be refactored out, or is circular injection a conceptually valid thing to do?