2 Replies Latest reply on Nov 1, 2012 6:01 PM by Fausto De La Torre

    EAR with 2 ejb modules(MDB) does not work

    Fausto De La Torre Newbie

      I have an ear file with two jar files, in the first jar file are classes with java entities, in this file in the META-INF folder are MANIFEST.MF and persistence.xml files, the persistence.xml file contains the data source declaration. In the second jar file I have one class which is annotated as @MessageDriven and session beans. Ear file contains META-INF folder, in this folder is the application.xml file, this file I put that jar1 and jar2 are ejb modules.

       

      When I deploy the ear file I get the next error: [ERROR]

       

      The error ocurre when I put the annotation @MessageDriven if I delete this annotation nothing bad happen.

       

      If I deploy the jar files separated (not in an ear file) everything works fine, but I need that those files are into an ear file

       

      I tried putting jndi.properties in the ear file but the error continue, in the jbossmq-destinations-service.xml I`ve already put the definition of the queue but nothin, the error continue.

       

      When I delete persistence.xml file from the first jar the error is solved, but I can not do that because this file contains the entity beans, I think the problem is in DataSource but I not 100% sure.

       

      I don not know what lse I can to do is the firs time that something like that happens to me

       

      PD: My english is not good but I hope you will understand me

      PD2: I attached the ear file, the mdb file and data source fil if this help.

       

      [ERROR]:

      10:08:15,707 WARN  [ServiceController] Problem starting service persistence.units:ear=LM.ear,unitName=punit

      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.GeneratedMethodAccessor9.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 $Proxy74.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.GeneratedMethodAccessor9.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.GeneratedMethodAccessor20.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:610)

      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)

      10:08:15,708 INFO  [EJB3Deployer] Deployed: file:/home/fausto/java/jboss/jboss-4.2.2.GA/server/instance/tmp/deploy/tmp2342606401094249511LM.ear-contents/entidad.jar

      10:08:15,721 INFO  [EARDeployer] Started J2EE application: file:/home/fausto/java/jboss/jboss-4.2.2.GA/server/instance/deploy/LM.ear