1 Reply Latest reply on Mar 28, 2008 1:36 AM by jaikiran pai

    Dependency bug with multiple modules in EAR

    Markus Dahm Novice

      Hi,

      I found a very strange bug in JBoss 4.2.2.GA (and a workaround, thank goodness!) when using an EAR with multiple
      modules/JARS in application.xml: We have several (Maven) projects each of which contains session beans and one
      project with the data model entities (EJB3). They each produce a JAR that goes into the EAR as a module.

      Now I added a new project that contained a simple MDB like this:

      @MessageDriven(activationConfig = {
       @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
       @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/testQueue") })
      public class RequestReceiverMDB implements MessageListener {
      ...
      }
      


      To my amazement the following exception occurred upon deployment:

      18:15:14,488 INFO [EARDeployer] Init J2EE application: file:/C:/server/Cellactive-Server/server/default/deploy/mps-serverapplication-1.4-SNAPSHOT.ear/
      18:15:15,004 WARN [MainDeployer] Found non-jar deployer for mps-datamodel-1.4-SNAPSHOT.jar: MBeanProxyExt[jboss.ejb3:service=EJB3Deployer]
      18:15:15,035 WARN [MainDeployer] Found non-jar deployer for mps-datamodel-1.4-SNAPSHOT.jar: MBeanProxyExt[jboss.ejb3:service=EJB3Deployer]
      18:15:15,082 WARN [MainDeployer] Found non-jar deployer for mps-operation-1.4-SNAPSHOT.jar: MBeanProxyExt[jboss.ejb3:service=EJB3Deployer]
      18:15:16,082 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
      18:15:16,082 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=jboss-seam-2.0.1.GA.jar,name=TimerServiceDispatcher,service=EJB3 with dependencies:
      18:15:16,175 INFO [EJBContainer] STARTED EJB: org.jboss.seam.async.TimerServiceDispatcher ejbName: TimerServiceDispatcher
      18:15:16,207 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateful.StatefulContainer
      18:15:16,207 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=jboss-seam-2.0.1.GA.jar,name=EjbSynchronizations,service=EJB3 with dependencies:
      18:15:16,222 INFO [EJBContainer] STARTED EJB: org.jboss.seam.transaction.EjbSynchronizations ejbName: EjbSynchronizations
      18:15:16,254 INFO [EJB3Deployer] Deployed: file:/C:/server/Cellactive-Server/server/default/deploy/mps-serverapplication-1.4-SNAPSHOT.ear/jboss-seam-2.0.1.GA.jar
      18:15:16,254 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.mdb.MDB
      18:15:16,254 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-acquireradapter-1.4-SNAPSHOT.jar,name=PaymentRequestReceiverMDB,service=EJB3 with dependencies:
      18:15:16,254 INFO [EJBContainer] STARTED EJB: com.cellactive.mp.acquirer.adapter.request.PaymentRequestReceiverMDB ejbName: PaymentRequestReceiverMDB
      18:15:16,269 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
      18:15:16,269 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-acquireradapter-1.4-SNAPSHOT.jar,name=DummyAcquirer,service=EJB3 with dependencies:
      18:15:16,285 INFO [EJBContainer] STARTED EJB: com.cellactive.mp.acquirer.dummy.DummyAcquirer ejbName: DummyAcquirer
      18:15:16,285 INFO [EJB3Deployer] Deployed: file:/C:/server/Cellactive-Server/server/default/deploy/mps-serverapplication-1.4-SNAPSHOT.ear/mps-acquireradapter-1.4-SNAPSHOT.jar
      18:15:16,332 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
      18:15:16,332 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-dataaccess-1.4-SNAPSHOT.jar,name=AdministratorServiceBean,service=EJB3 with dependencies:
      18:15:16,332 INFO [JmxKernelAbstraction] jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-dataaccess-1.4-SNAPSHOT.jar,name=EventLoggerServiceBean,service=EJB3
      18:15:16,332 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
      18:15:16,332 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-dataaccess-1.4-SNAPSHOT.jar,name=ClerkServiceBean,service=EJB3 with dependencies:
      18:15:16,332 INFO [JmxKernelAbstraction] jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-dataaccess-1.4-SNAPSHOT.jar,name=EventLoggerServiceBean,service=EJB3
      18:15:16,332 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
      18:15:16,332 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-dataaccess-1.4-SNAPSHOT.jar,name=EventLoggerServiceBean,service=EJB3 with dependencies:
      18:15:16,347 INFO [EJBContainer] STARTED EJB: com.cellactive.mp.server.dao.EventLoggerServiceBean ejbName: EventLoggerServiceBean
      18:15:16,363 INFO [EJBContainer] STARTED EJB: com.cellactive.mp.server.admin.dao.AdministratorServiceBean ejbName: AdministratorServiceBean
      18:15:16,394 INFO [EJBContainer] STARTED EJB: com.cellactive.mp.server.clerk.dao.ClerkServiceBean ejbName: ClerkServiceBean
      18:15:16,425 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
      18:15:16,425 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-dataaccess-1.4-SNAPSHOT.jar,name=AccountInformationServiceBean,service=EJB3 with dependencies:
      18:15:16,425 INFO [EJBContainer] STARTED EJB: com.cellactive.mp.server.paymentparty.dao.AccountInformationServiceBean ejbName: AccountInformationServiceBean
      18:15:16,441 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
      18:15:16,441 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-dataaccess-1.4-SNAPSHOT.jar,name=PaymentAccountServiceBean,service=EJB3 with dependencies:
      18:15:16,441 INFO [JmxKernelAbstraction] jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-dataaccess-1.4-SNAPSHOT.jar,name=EventLoggerServiceBean,service=EJB3
      18:15:16,457 INFO [EJBContainer] STARTED EJB: com.cellactive.mp.server.paymentparty.dao.PaymentAccountServiceBean ejbName: PaymentAccountServiceBean
      18:15:16,472 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
      18:15:16,472 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-dataaccess-1.4-SNAPSHOT.jar,name=PaymentPartyServiceBean,service=EJB3 with dependencies:
      18:15:16,472 INFO [JmxKernelAbstraction] jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-dataaccess-1.4-SNAPSHOT.jar,name=EventLoggerServiceBean,service=EJB3
      18:15:16,488 INFO [EJBContainer] STARTED EJB: com.cellactive.mp.server.paymentparty.dao.PaymentPartyServiceBean ejbName: PaymentPartyServiceBean
      18:15:16,488 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
      18:15:16,488 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-dataaccess-1.4-SNAPSHOT.jar,name=SpendingLimitServiceBean,service=EJB3 with dependencies:
      18:15:16,504 INFO [EJBContainer] STARTED EJB: com.cellactive.mp.server.paymentparty.dao.SpendingLimitServiceBean ejbName: SpendingLimitServiceBean
      18:15:16,519 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
      18:15:16,519 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-dataaccess-1.4-SNAPSHOT.jar,name=TerminalDeviceServiceBean,service=EJB3 with dependencies:
      18:15:16,519 INFO [JmxKernelAbstraction] jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-dataaccess-1.4-SNAPSHOT.jar,name=EventLoggerServiceBean,service=EJB3
      18:15:16,535 INFO [EJBContainer] STARTED EJB: com.cellactive.mp.server.paymentparty.dao.TerminalDeviceServiceBean ejbName: TerminalDeviceServiceBean
      18:15:16,535 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
      18:15:16,535 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-dataaccess-1.4-SNAPSHOT.jar,name=UserMaintenanceServiceBean,service=EJB3 with dependencies:
      18:15:16,535 INFO [EJBContainer] STARTED EJB: com.cellactive.mp.server.user.dao.UserMaintenanceServiceBean ejbName: UserMaintenanceServiceBean
      18:15:16,550 INFO [EJB3Deployer] Deployed: file:/C:/server/Cellactive-Server/server/default/deploy/mps-serverapplication-1.4-SNAPSHOT.ear/mps-dataaccess-1.4-SNAPSHOT.jar
      18:15:16,550 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.entity.PersistenceUnitDeployment
      18:15:16,550 INFO [JmxKernelAbstraction] installing MBean: persistence.units:ear=mps-serverapplication-1.4-SNAPSHOT.ear,unitName=MpsDataModel with dependencies:
      18:15:16,550 INFO [JmxKernelAbstraction] jboss.jca:name=MPS-DS,service=DataSourceBinding
      18:15:16,550 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.units:ear=mps-serverapplication-1.4-SNAPSHOT.ear,unitName=MpsDataModel
      18:15:16,550 WARN [ServiceController] Problem starting service persistence.units:ear=mps-serverapplication-1.4-SNAPSHOT.ear,unitName=MpsDataModel
      javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
       at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
       at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
       at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
       at javax.naming.InitialContext.lookup(InitialContext.java:351)
       at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:216)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy235.start(Unknown Source)
       at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:120)
       at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:627)
       at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:351)
       at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy33.start(Unknown Source)
       at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:512)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
       at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
       at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
       at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
       at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy34.start(Unknown Source)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy9.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      18:15:16,550 INFO [EJB3Deployer] Deployed: file:/C:/server/Cellactive-Server/server/default/deploy/mps-serverapplication-1.4-SNAPSHOT.ear/mps-datamodel-1.4-SNAPSHOT.jar
      18:15:16,597 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.service.ServiceContainer
      18:15:16,597 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=mps-serverapplication-1.4-SNAPSHOT.ear,jar=mps-management-1.4-SNAPSHOT.jar,name=AdministratorManagementBean,service=EJB3 with dependencies:


      After quite some time I found that it worked, when I manually renamed the JARs so that the one with the MDB was last
      (JBoss scans the JARs in alphabetical order, I don't know if that's OK). It also worked if everything was merged into one
      single JAR.
      Further investigations showed that the project with the datamodel (and the persistence.xml) must come before the one with the MDB.
      Altough the latter has no dependencies to the datamodel!

      The workaround I found was the following, I added an @Dependency anotation to the MDB:
      ...
      @Depends("jboss.j2ee:module=mps-datamodel-1.4-SNAPSHOT.jar,service=EJB3")
      


      Now it works again. However, I consider this a serious and confusing Bug in JBoss. Unless you prove it has to be
      this way :-)

      Cheers
      Markus