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
> <sys:moduleId>
> <sys:groupId>myejbmodule</sys:groupId>
> <sys:artifactId>Dispatcher</sys:artifactId>
> <sys:version>1.0</sys:version>
> <sys:type>jar</sys:type>
> </sys:moduleId>
>
> B) Application contains two ejb-jars with beans
>
> geronimo-application.xml contains
> <dependencies>
> <dependency>
> <groupId>myejbmodule</groupId>
> <artifactId>Dispatcher</artifactId>
> <version>1.0</version>
> <type>jar</type>
> </dependency>
> </dependencies>
>
> 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(<generated>)
> 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(<generated>)
> at
> org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:576)
> at
> org.apache.geronimo.j2ee.deployment.EARConfigBuilder$$FastClassByCGLIB$$38e56ec6.invoke(<generated>)
> 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(<generated>)
> 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(<generated>)
> 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(<generated>)
> 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(<generated>)
> 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(<generated>)
> 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.