users@glassfish.java.net

Re: Define two instances of same bean in ejb-jar and sun-ejb-jar

From: <glassfish_at_javadesktop.org>
Date: Mon, 15 Jun 2009 07:12:55 PDT

Hi again,

so here is my test case.
I have created two queues: 'queue/TestMDB' and 'queue/TestMDB2'.
The EJB and the UnitTest are attached. The UnitTest just sends a message to both queues but it seems both messages are received by the first bean. This seems to be caused by the fact that the second bean is not correctly deployed but I do not see strange messages on deploy:


[#|2009-06-15T16:03:04.954+0200|INFO|sun-appserver2.1|javax.enterprise.system.tools.deployment|_ThreadID=14;_ThreadName=Timer-6;|deployed with moduleid = testing.ejbeans.testmultipleejbs-ejb|#]

[#|2009-06-15T16:03:05.230+0200|INFO|sun-appserver2.1|javax.enterprise.resource.resourceadapter|_ThreadID=14;_ThreadName=Timer-6;javax.jms.Queue;queue/TestMDB;TestMDB;|endpoint.determine.destinationtype|#]

[#|2009-06-15T16:03:05.292+0200|INFO|sun-appserver2.1|javax.enterprise.resource.resourceadapter|_ThreadID=14;_ThreadName=Timer-6;javax.jms.Queue;queue/TestMDB2;TestMDB2;|endpoint.determine.destinationtype|#]

[#|2009-06-15T16:03:05.361+0200|INFO|sun-appserver2.1|javax.enterprise.system.core.classloading|_ThreadID=14;_ThreadName=Timer-6;testing.ejbeans.testmultipleejbs-ejb;|LDR5010: All ejb(s) of [testing.ejbeans.testmultipleejbs-ejb] loaded successfully!|#]

Everything looks fine.

However, if I uncomment the first EJB from the ejb-jar.xml then the deployment fails with the following stack trace:

[#|2009-06-15T16:01:43.877+0200|INFO|sun-appserver2.1|javax.enterprise.resource.resourceadapter|_ThreadID=14;_ThreadName=Timer-6;javax.jms.Queue;queue/TestMDB2;TestMDB2;|endpoint.determine.destinationtype|#]

[#|2009-06-15T16:01:44.183+0200|SEVERE|sun-appserver2.1|javax.enterprise.system.container.ejb.mdb|_ThreadID=14;_ThreadName=Timer-6;TestMDB;com.sun.enterprise.connectors.ConnectorRuntimeException: JMS resource not created : ;_RequestID=6b1be7ba-0461-4701-8714-5ef630719d45;|MDB000
17: [TestMDB]: Exception in creating message-driven bean container: [com.sun.enterprise.connectors.ConnectorRuntimeException: JMS resource not created : ]|#]

[#|2009-06-15T16:01:44.185+0200|SEVERE|sun-appserver2.1|javax.enterprise.system.container.ejb.mdb|_ThreadID=14;_ThreadName=Timer-6;_RequestID=6b1be7ba-0461-4701-8714-5ef630719d45;|com.sun.enterprise.connectors.ConnectorRuntimeException
com.sun.enterprise.connectors.ConnectorRuntimeException: JMS resource not created :
        at com.sun.enterprise.connectors.system.ActiveJmsResourceAdapter.getPhysicalDestinationFromConfiguration(ActiveJmsResourceAdapter.java:1591)
        at com.sun.enterprise.connectors.system.ActiveJmsResourceAdapter.updateMDBRuntimeInfo(ActiveJmsResourceAdapter.java:1421)
        at com.sun.enterprise.connectors.inflow.ConnectorMessageBeanClient.setup(ConnectorMessageBeanClient.java:170)
        at com.sun.ejb.containers.MessageBeanContainer.<init>(MessageBeanContainer.java:209)
        at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:280)
        at com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:527)
        at com.sun.enterprise.server.EJBModuleLoader.doLoad(EJBModuleLoader.java:171)
        at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:238)
        at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(StandAloneEJBModulesManager.java:233)
        at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(StandAloneEJBModulesManager.java:188)
        at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(StandAloneEJBModulesManager.java:420)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:1005)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent(AdminEventMulticaster.java:992)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:470)
        at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:182)
        at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
        at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:231)
        at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:298)
        at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:132)
        at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:966)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:280)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:298)
        at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.deploy(ApplicationsConfigMBean.java:584)
        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:597)
        at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:381)
        at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:364)
        at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:477)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
        at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
        at $Proxy1.invoke(Unknown Source)
        at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
        at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
        at com.sun.enterprise.deployment.autodeploy.AutoDeployer.invokeDeploymentService(AutoDeployer.java:583)
        at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployJavaEEArchive(AutoDeployer.java:564)
        at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:495)
        at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:270)
        at com.sun.enterprise.deployment.autodeploy.AutoDeployControllerImpl$AutoDeployTask.run(AutoDeployControllerImpl.java:374)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)
|#]


Do you have any suggestions?

Thanks in advance,
Chris
[Message sent by forum member 'chrjohn' (chrjohn)]

http://forums.java.net/jive/thread.jspa?messageID=351201