2 Replies Latest reply on Dec 1, 2011 6:47 AM by Kavan Desai

    Circular dependency error while deploying ear

    Kavan Desai Newbie

      Hi,

       

      I am getting following circular dependency error while deploying ear of daytrader opensource application, containing ejb jar and war while. I am able to deploy ejb jar seperately however after packageing both in ear I am getting the error. I am attaching the web application serverlet code which is accessing TradeBrokerQueue. I have also attached the standalone-full.xml and the SLSB class where the resources are injected.

       

      11:41:55,163 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-3) JNDI bindings for session bean named DirectSLSBBean in deployment unit subdeployment "DayTraderEJB.jar" of deployment "DayTraderApp.ear" are as follows:

       

          java:global/DayTraderApp/DayTraderEJB/DirectSLSBBean!org.apache.geronimo.samples.daytrader.ejb3.DirectSLSBRemote

          java:app/DayTraderEJB/DirectSLSBBean!org.apache.geronimo.samples.daytrader.ejb3.DirectSLSBRemote

          java:module/DirectSLSBBean!org.apache.geronimo.samples.daytrader.ejb3.DirectSLSBRemote

          java:global/DayTraderApp/DayTraderEJB/DirectSLSBBean!org.apache.geronimo.samples.daytrader.ejb3.DirectSLSBLocal

          java:app/DayTraderEJB/DirectSLSBBean!org.apache.geronimo.samples.daytrader.ejb3.DirectSLSBLocal

          java:module/DirectSLSBBean!org.apache.geronimo.samples.daytrader.ejb3.DirectSLSBLocal

       

      11:41:55,163 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-3) JNDI bindings for session bean named TradeSLSBBean in deployment unit subdeployment "DayTraderEJB.jar" of deployment "DayTraderApp.ear" are as follows:

       

          java:global/DayTraderApp/DayTraderEJB/TradeSLSBBean!org.apache.geronimo.samples.daytrader.ejb3.TradeSLSBLocal

          java:app/DayTraderEJB/TradeSLSBBean!org.apache.geronimo.samples.daytrader.ejb3.TradeSLSBLocal

          java:module/TradeSLSBBean!org.apache.geronimo.samples.daytrader.ejb3.TradeSLSBLocal

          java:global/DayTraderApp/DayTraderEJB/TradeSLSBBean!org.apache.geronimo.samples.daytrader.ejb3.TradeSLSBRemote

          java:app/DayTraderEJB/TradeSLSBBean!org.apache.geronimo.samples.daytrader.ejb3.TradeSLSBRemote

          java:module/TradeSLSBBean!org.apache.geronimo.samples.daytrader.ejb3.TradeSLSBRemote

       

      11:41:55,190 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.subunit."DayTraderApp.ear"."DayTraderWebApp.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."DayTraderApp.ear"."DayTraderWebApp.war".INSTALL: Failed to process phase INSTALL of subdeployment "DayTraderWebApp.war" of deployment "DayTraderApp.ear"

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.1.0.Beta1.jar:]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_27]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_27]

          at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]

      Caused by: java.lang.IllegalArgumentException: JBAS011043: Circular dependency installing java:module/env/jms/TradeBrokerQueue

          at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.addJndiBinding(ModuleJndiBindingProcessor.java:225)

          at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:104)

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.1.0.Beta1.jar:]

          ... 5 more

       

      I was able to deploy the ear successfully in JBOSS AS 6.1.0 Final.

        • 1. Re: Circular dependency error while deploying ear
          jaikiran pai Master

          Your jboss-web.xml has this:

           

          <message-destination-ref> 
              <message-destination-ref-name>jms/TradeBrokerQueue</message-destination-ref-name> 
              <jndi-name>jms/TradeBrokerQueue</jndi-name> 
          </message-destination-ref> 
          <message-destination-ref> 
              <message-destination-ref-name>jms/TradeStreamerTopic</message-destination-ref-name> 
              <jndi-name>jms/TradeStreamerTopic</jndi-name> 
          </message-destination-ref> 
           <resource-ref> 
           <res-ref-name>jms/QueueConnectionFactory</res-ref-name> 
           <jndi-name>ConnectionFactory</jndi-name> 
           </resource-ref> 
           <resource-ref> 
           <res-ref-name>jms/TopicConnectionFactory</res-ref-name> 
           <jndi-name>ConnectionFactory</jndi-name> 
           </resource-ref> 
           <ejb-ref>   
             <ejb-ref-name>TradeSLSBBean</ejb-ref-name>   
             <jndi-name>ejb/TradeSLSBBean</jndi-name>   
           </ejb-ref>   
           <ejb-ref>   
             <ejb-ref-name>DirectSLSBBean</ejb-ref-name>   
             <jndi-name>DirectSLSBBean</jndi-name>   
           </ejb-ref>
          

           

           

          change it to:

           

          <message-destination-ref>
              <message-destination-ref-name>jms/TradeBrokerQueue</message-destination-ref-name>
              <jndi-name>java:/jms/TradeBrokerQueue</jndi-name>
          </message-destination-ref>
          <message-destination-ref>
              <message-destination-ref-name>jms/TradeStreamerTopic</message-destination-ref-name>
              <jndi-name>java:/jms/TradeStreamerTopic</jndi-name>
          </message-destination-ref>
           <resource-ref>
           <res-ref-name>jms/QueueConnectionFactory</res-ref-name>
           <jndi-name>java:/ConnectionFactory</jndi-name>
           </resource-ref>
           <resource-ref>
           <res-ref-name>jms/TopicConnectionFactory</res-ref-name>
           <jndi-name>java:/ConnectionFactory</jndi-name>
           </resource-ref>
           <ejb-ref>  
             <ejb-ref-name>TradeSLSBBean</ejb-ref-name>  
             <jndi-name>java:app/DayTraderEJB/TradeSLSBBean!org.apache.geronimo.samples.daytrader.ejb3.TradeSLSBRemote</jndi-name>  
           </ejb-ref>  
           <ejb-ref>  
             <ejb-ref-name>DirectSLSBBean</ejb-ref-name>  
             <jndi-name>java:app/DayTraderEJB/DirectSLSBBean!org.apache.geronimo.samples.daytrader.ejb3.DirectSLSBRemote</jndi-name>  
           </ejb-ref> 
          
          
          • 2. Re: Circular dependency error while deploying ear
            Kavan Desai Newbie

            Thanks a lot Jaikiran it worked!! I did change jndi-name in jboss.xml however missed jboss-web.xml thanks a lot again.