Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 55617 invoked from network); 19 Sep 2007 23:10:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Sep 2007 23:10:47 -0000 Received: (qmail 30539 invoked by uid 500); 19 Sep 2007 23:10:38 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 30529 invoked by uid 500); 19 Sep 2007 23:10:38 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 30518 invoked by uid 99); 19 Sep 2007 23:10:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2007 16:10:37 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2007 23:12:34 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1IY8gQ-0004FQ-Er for user@geronimo.apache.org; Wed, 19 Sep 2007 16:10:14 -0700 Message-ID: <12787921.post@talk.nabble.com> Date: Wed, 19 Sep 2007 16:10:14 -0700 (PDT) From: Tomasz Mazan To: user@geronimo.apache.org Subject: Re: Problem with referencing to beans from other ejb-jars In-Reply-To: <12654889.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: wind22@wp.pl References: <12654889.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Tomasz Mazan wrote: > > Hello > > I got deployed module A (JAR) and application B (EAR). > > A) Contains stateless bean > > @Stateless(name = "JmsDispatcherGate") > public class JmsDispatcherGateImpl implements DispatcherGateLocal, > DispatcherGateRemote { > > and - of course - necessary interfaces. > > ejb-jar.xml does'nt contain interesting content, > openejb-jar.xml contains module description > > myejbmodule > Dispatcher > 1.0 > jar > > > B) Application contains two ejb-jars with beans > > geronimo-application.xml contains > > > myejbmodule > Dispatcher > 1.0 > jar > > > > and one of B-module has openejb-jar.xml with similar dependencie's > definition. > Bean in B-module references to bean from A (EJB) using code below: > > @EJB(name = "JmsDispatcherGate") > private DispatcherGateLocal dispatcherGate; > > Problem occurs on deploying B-application (EAR) while A (EJB) is correctly > deployed and Geronimo Console JNDI Viewer show JmsDispatcherGate bean. I > tried to use Remote interface - with no special difference. > > Exception stacktrace: > 15:31:18,812 FATAL [startup] Cannot find bean "JmsDispatcherGate" > referenced by bean "CoreManagerLocal". > 15:31:18,812 ERROR [Deployer] Deployment failed due to > org.apache.geronimo.common.DeploymentException: > org.apache.openejb.OpenEJBException: Cannot find bean "JmsDispatcherGate" > referenced by bean "CoreManagerLocal". > at > org.apache.geronimo.openejb.deployment.EjbModuleBuilder.getEjbJarInfo(EjbModuleBuilder.java:530) > at > org.apache.geronimo.openejb.deployment.EjbModuleBuilder.initContext(EjbModuleBuilder.java:437) > at > org.apache.geronimo.openejb.deployment.EjbModuleBuilder$$FastClassByCGLIB$$cd80af20.invoke() > at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53) > at > org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38) > at > org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124) > at > org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:830) > at > org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57) > at > org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35) > at > org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96) > at > org.apache.geronimo.j2ee.deployment.ModuleBuilder$$EnhancerByCGLIB$$dc485bed.initContext() > at > org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:576) > at > org.apache.geronimo.j2ee.deployment.EARConfigBuilder$$FastClassByCGLIB$$38e56ec6.invoke() > at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53) > at > org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38) > at > org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124) > at > org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:830) > at > org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57) > at > org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35) > at > org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96) > at > org.apache.geronimo.j2ee.deployment.CorbaGBeanNameSource$$EnhancerByCGLIB$$1375d602.buildConfiguration() > at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:304) > at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:126) > at > org.apache.geronimo.deployment.Deployer$$FastClassByCGLIB$$734a235d.invoke() > at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53) > at > org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38) > at > org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124) > at > org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:865) > at > org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239) > at org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:342) > at > org.apache.geronimo.kernel.KernelGBean$$FastClassByCGLIB$$1cccefc9.invoke() > at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53) > at > org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38) > at > org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124) > at > org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:865) > at > org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239) > at > org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke(MBeanGBeanBridge.java:168) > at > com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213) > at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220) > at > com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815) > at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784) > at > javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1408) > at > javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectionImpl.java:81) > at > javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1245) > at java.security.AccessController.doPrivileged(Native Method) > at > javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1348) > at > javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:782) > at sun.reflect.GeneratedMethodAccessor217.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294) > at sun.rmi.transport.Transport$1.run(Transport.java:153) > at java.security.AccessController.doPrivileged(Native Method) > at sun.rmi.transport.Transport.serviceCall(Transport.java:149) > at > sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466) > at > sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707) > at java.lang.Thread.run(Thread.java:595) > Caused by: org.apache.openejb.OpenEJBException: Cannot find bean > "JmsDispatcherGate" referenced by bean "CoreManagerLocal". > at > org.apache.openejb.config.JndiEncInfoBuilder.buildEjbLocalRefInfos(JndiEncInfoBuilder.java:371) > at > org.apache.openejb.config.JndiEncInfoBuilder.build(JndiEncInfoBuilder.java:245) > at > org.apache.openejb.config.JndiEncInfoBuilder.initJndiReferences(JndiEncInfoBuilder.java:166) > at > org.apache.openejb.config.JndiEncInfoBuilder.initJndiReferences(JndiEncInfoBuilder.java:102) > at > org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:340) > at > org.apache.geronimo.openejb.OpenEjbSystemGBean.configureApplication(OpenEjbSystemGBean.java:303) > at > org.apache.geronimo.openejb.OpenEjbSystemGBean$$FastClassByCGLIB$$5005cdd0.invoke() > at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53) > at > org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38) > at > org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124) > at > org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:830) > at > org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57) > at > org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35) > at > org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96) > at > org.apache.geronimo.openejb.OpenEjbSystem$$EnhancerByCGLIB$$e2a54c40.configureApplication() > at > org.apache.geronimo.openejb.deployment.EjbModuleBuilder.getEjbJarInfo(EjbModuleBuilder.java:515) > ... 56 more > > Any idea what goes wrong and how to make it working? > > tia > Beniamin > Tanks to David Blevins and David Jenks, I got solution for my references. All, that I need is one additional attribute "mappedName" with value set to deploymentId of A-jar. So annotation of bean from B application EAR should looks like: @EJB(name = "JmsDispatcherGate", mappedName="deploymentId") private DispatcherGateLocal dispatcherGate; where deployment id can equals as well "ArtifactId" as "ArtifactId.jar" of my ejb.jar Alternative is to modify openejb-jar.xml, but I couldn't force to work my application using this approach. -- View this message in context: http://www.nabble.com/Problem-with-referencing-to-beans-from-other-ejb-jars-tf4435740s134.html#a12787921 Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.