0 Replies Latest reply on Mar 11, 2013 5:00 AM by Natasha Biryukov

    Dependency between two EJBs during deployment time, No EJB receiver available

    Natasha Biryukov Newbie

      Hi all,

      We're in a middle of migration from JBoss 4 to JBoss7.1.1 Final version.

      I have two EJBs packed in ejb1.jar and ejb2.jar.

      The startup code of ejb1.jar requires the EJBs in ejb2.jar to be deployed, so in the jboss-deployment-structure.xml of ejb1.jar i defined the dependency on ejb2.jar:

       

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">

          <deployment>

              <dependencies>

                  <module name="deployment.ejb2.jar" />           

              </dependencies>

          </deployment>

      </jboss-deployment-structure>

       

      But when those two jars are being deployed I see (in the server.log)  that the deployment of ejb1.jar is starting before the deployment of ejb2.jar ended,

      as the result of it the ejb1.jar fails to deploy with the following error:

       

      2013-03-11 09:18:52,755 - 09:18:52,720 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."ejb1.jar".component.MyRegistrationBean.START: org.jboss.msc.service.StartException in service jboss.deployment.unit."ejb1.jar".component.MyRegistrationBean.START: Failed to start service

      2013-03-11 09:18:52,755 -           at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

      2013-03-11 09:18:52,756 -           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09]

      2013-03-11 09:18:52,756 -           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09]

      2013-03-11 09:18:52,756 -           at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]

      2013-03-11 09:18:52,756 - Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance

      2013-03-11 09:18:52,756 -           at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)

      2013-03-11 09:18:52,756 -           at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85)

      2013-03-11 09:18:52,756 -           at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:116)

      2013-03-11 09:18:52,756 -           at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:130)

      2013-03-11 09:18:52,756 -           at org.jboss.as.ee.component.ComponentStartService.start(ComponentStartService.java:44)

      2013-03-11 09:18:52,756 -           at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

      2013-03-11 09:18:52,756 -           at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

      2013-03-11 09:18:52,756 -           ... 3 more

      2013-03-11 09:18:52,756 - Caused by: javax.ejb.EJBException: java.lang.RuntimeException: Failed to load TAS configurations

      2013-03-11 09:18:52,756 -           at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:166)

      2013-03-11 09:18:52,756 -           at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230)

      2013-03-11 09:18:52,756 -           at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:333)

      2013-03-11 09:18:52,756 -           at org.jboss.as.ejb3.tx.SingletonLifecycleCMTTxInterceptor.processInvocation(SingletonLifecycleCMTTxInterceptor.java:56)

      2013-03-11 09:18:52,756 -           at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      2013-03-11 09:18:52,756 -           at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

      2013-03-11 09:18:52,756 -           at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      2013-03-11 09:18:52,757 -           at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

      2013-03-11 09:18:52,757 -           at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      2013-03-11 09:18:52,757 -           at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

      2013-03-11 09:18:52,757 -           at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)

      2013-03-11 09:18:52,757 -           ... 9 more

      2013-03-11 09:18:52,757 - Caused by: java.lang.RuntimeException: Failed to load MY configurations

      2013-03-11 09:18:52,757 -           at com.my.engine.config.bean.MyRegistrationBean.init(MyRegistrationBean.java:33)

      2013-03-11 09:18:52,757 -           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_09]

      2013-03-11 09:18:52,757 -           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_09]

      2013-03-11 09:18:52,757 -           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09]

      2013-03-11 09:18:52,757 -           at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_09]

      2013-03-11 09:18:52,757 -           at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptorFactory.java:130)

      2013-03-11 09:18:52,757 -           at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      2013-03-11 09:18:52,757 -           at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

      2013-03-11 09:18:52,757 -           at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      2013-03-11 09:18:52,757 -           at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95)

      2013-03-11 09:18:52,757 -           at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      2013-03-11 09:18:52,757 -           at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

      2013-03-11 09:18:52,757 -           at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      2013-03-11 09:18:52,757 -           at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

      2013-03-11 09:18:52,759 -           at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      2013-03-11 09:18:52,759 -           at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228)

      2013-03-11 09:18:52,759 -           ... 18 more

      2013-03-11 09:18:52,759 - Caused by: com.my.engine.support.MyEngineException: Failed due to exception

      2013-03-11 09:18:52,759 -           at com.my.engine.support.configuration.MyMetadataLoaderManager.loadIs(MyMetadataLoaderManager.java:238)

      2013-03-11 09:18:52,760 -           at com.my.engine.support.configuration.MyMetadataLoaderManager.configureAll(MyMetadataLoaderManager.java:155)

      2013-03-11 09:18:52,760 -           at com.my.engine.support.configuration.MyMetadataLoaderManager.configureAll(MyMetadataLoaderManager.java:132)

      2013-03-11 09:18:52,760 -           at com.my.engine.config.bean.MyRegistrationBean.init(MyRegistrationBean.java:29)

      2013-03-11 09:18:52,760 -           ... 33 more

      2013-03-11 09:18:52,760 - Caused by: java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:ejb2,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@41ad8727

      2013-03-11 09:18:52,760 -           at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:584)

      2013-03-11 09:18:52,760 -           at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:119)

      2013-03-11 09:18:52,760 -           at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)

      2013-03-11 09:18:52,760 -           at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)

      2013-03-11 09:18:52,760 -           at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)

      2013-03-11 09:18:52,760 -           at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)

      2013-03-11 09:18:52,760 -           at $Proxy51.create(Unknown Source)          at com.my.engine.ejbs.EngineFactory.getEngineManager(EngineFactory.java:81)

      2013-03-11 09:18:52,760 -           at com.my.engine.support.configuration.MyMetadataLoaderManager.loadls(MyMetadataLoaderManager.java:233)

      2013-03-11 09:18:52,760 -           ... 36 more

       

      When I deploy those jars one by one in the right order, the deployment works fine.

       

      The question is why the deployment of ejb1.jar is starting before the deployment of ebj2.jar is finished, isn't the dependency mechanism should protect me from such things?

      If not, what is the right solution for such things?

       

      Thanks is advance,

      Natasha