You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Tomasz Mazan <wi...@wp.pl> on 2007/09/13 15:58:58 UTC
Problem with referencing to beans from other ejb-jars
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
--
View this message in context: http://www.nabble.com/Problem-with-referencing-to-beans-from-other-ejb-jars-tf4435740s134.html#a12654889
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Problem with referencing to beans from other ejb-jars
Posted by Tomasz Mazan <wi...@wp.pl>.
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.
Re: Problem with referencing to beans from other ejb-jars
Posted by Tomasz Mazan <wi...@wp.pl>.
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
>
Thanks 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 Bean within A-jar.
Annotation for bean reference within B application EAR should looks like:
@EJB(mappedName="deploymentId")
private DispatcherGateLocal dispatcherGate;
where deployment id quals "ArtifactId/beanName" - here
"myejbmodule/JmsDispatcherGate"
I can use Local interface cause EAR B-application descriptor contains
dependency to A Ejb-jar. In other case it would be necessary to use Remote
interface instead of Local.
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.
Re: Problem with referencing to beans from other ejb-jars
Posted by Tomasz Mazan <wi...@wp.pl>.
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
>
Thanks 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 Bean within A-jar.
1st approach
Annotation for bean reference within B application EAR should looks like:
@EJB(mappedName="deploymentId")
private DispatcherGateLocal dispatcherGate;
where deployment id quals "ArtifactId/beanName" - here
"myejbmodule/JmsDispatcherGate"
I can use Local interface cause EAR B-application descriptor contains
dependency to A Ejb-jar. In other case it would be necessary to use Remote
interface instead of Local.
2nd approach
Alternative is to modify openejb-jar.xml like shown below:
Left java-annotation like usual for reference to another bean (both in the
same EAR/JAR)
@EJB(name="_REF_NAME_")
private DispatcherGateLocal dispatcherGate;
and insert into openejb-jar.xml:
<openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2"
xmlns:pkgen="http://www.openejb.org/xml/ns/pkgen-2.0"
xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
<sys:environment>
<sys:moduleId>
<sys:groupId>mygroup1</sys:groupId>
<sys:artifactId>Services</sys:artifactId>
<sys:version>1.0</sys:version>
<sys:type>jar</sys:type>
</sys:moduleId>
<sys:dependencies>
<sys:dependency>
<sys:groupId>mygroup2</sys:groupId>
<sys:artifactId>OUTER_MODULE</sys:artifactId>
<sys:version>1.0</sys:version>
<sys:type>jar</sys:type>
</sys:dependency>
</sys:dependencies>
</sys:environment>
<enterprise-beans>
<session>
<!-- name of bean that wants to use bean from another jar -->
<ejb-name>MyServiceBean</ejb-name>
<ejb-ref>
<!-- @EJB(name="REF_NAME") DispatcherGateRemote dispatcherGate; -->
<ref-name>REF_NAME</ref-name>
<nam:pattern
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
<nam:artifactId>OUTER_MODULE</nam:artifactId>
<nam:name>NAME_OF_REFERED_BEAN</nam:name>
</nam:pattern>
</ejb-ref>
</session>
</enterprise-beans>
</openejb-jar>
3rd approach
It's very similar to 2nd, but you don't have to use name attribute in @EJB
annotation, so java code (of bean i.e. my.package.SuperServiceBean) looks
like
@EJB
private DispatcherGateLocal dispatcherGate;
and corresponding openejb-jar.xml:
<openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2"
xmlns:pkgen="http://www.openejb.org/xml/ns/pkgen-2.0"
xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
<sys:environment>
<sys:moduleId>
<sys:groupId>mygroup1</sys:groupId>
<sys:artifactId>Services</sys:artifactId>
<sys:version>1.0</sys:version>
<sys:type>jar</sys:type>
</sys:moduleId>
<sys:dependencies>
<sys:dependency>
<sys:groupId>mygroup2</sys:groupId>
<sys:artifactId>OUTER_MODULE</sys:artifactId>
<sys:version>1.0</sys:version>
<sys:type>jar</sys:type>
</sys:dependency>
</sys:dependencies>
</sys:environment>
<enterprise-beans>
<session>
<!-- name of bean that wants to use bean from another jar -->
<ejb-name>MyServiceBean</ejb-name>
<ejb-ref>
<!-- @EJB DispatcherGateRemote dispatcherGate; -->
<ref-name>my.package.SuperServiceBean/dispatcherGate</ref-name>
<nam:pattern
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
<nam:artifactId>OUTER_MODULE</nam:artifactId>
<nam:name>NAME_OF_REFERED_BEAN</nam:name>
</nam:pattern>
</ejb-ref>
</session>
</enterprise-beans>
</openejb-jar>
I think it's obvious you have to replace CAPITAL strings with suitable
values.
Maybe not obviuos but intuitive is that the best approach is no 2.
--
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.
Re: Problem with referencing to beans from other ejb-jars
Posted by David Blevins <da...@visi.com>.
On Sep 13, 2007, at 10:31 PM, Kevan Miller wrote:
> I thought I'd take the opportunity to send some love David B's
> way... I think it's great the way he's been addressing these user
> questions and documenting in the Wiki.
Thanks! :)
> I hope we can get this stuff organized so that users can find this
> information in a reasonable manner...
Yea, I've been thinking about that too. Not entirely sure where to
sew it into the larger tapestry that is our documentation.
-David
>
> --kevan
>
> On Sep 13, 2007, at 3:54 PM, David Blevins wrote:
>
>> Hi Tomasz,
>>
>> I created a doc for you that describes the missing parts.
>>
>> http://cwiki.apache.org/OPENEJB/ejb-refs.html
>>
>> Keep what you have with the openejb-jar and add the parts
>> described in this to your ejb-jar.xml.
>>
>> Unfortunately, while looking into this I discovered that our code
>> for overriding an @EJB annotation with an <ejb-ref> in the xml is
>> not implemented, thus if you have @EJB and the corresponding <ejb-
>> ref> as described in the first section of the document, you'll end
>> up with two refs and not one as you should.
>>
>> We'll get this fixed asap, but until then follow the technique
>> described in the second part of the doc and in the next version of
>> Geronimo you'll be able to delete some of that xml and readd the
>> @EJB annotation.
>>
>> -David
>>
>>
>>
>> On Sep 13, 2007, at 6:58 AM, 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.getEjbJarInf
>>> o(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.buildConfigurat
>>> ion(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.getEjbJarInf
>>> o(EjbModuleBuilder.java:515)
>>> ... 56 more
>>>
>>> Any idea what goes wrong and how to make it working?
>>>
>>> tia
>>> Beniamin
>>> --
>>> View this message in context: http://www.nabble.com/Problem-with-
>>> referencing-to-beans-from-other-ejb-jars-
>>> tf4435740s134.html#a12654889
>>> Sent from the Apache Geronimo - Users mailing list archive at
>>> Nabble.com.
>>>
>>>
>>
>
>
Re: Problem with referencing to beans from other ejb-jars
Posted by Kevan Miller <ke...@gmail.com>.
I thought I'd take the opportunity to send some love David B's way...
I think it's great the way he's been addressing these user questions
and documenting in the Wiki.
I hope we can get this stuff organized so that users can find this
information in a reasonable manner...
--kevan
On Sep 13, 2007, at 3:54 PM, David Blevins wrote:
> Hi Tomasz,
>
> I created a doc for you that describes the missing parts.
>
> http://cwiki.apache.org/OPENEJB/ejb-refs.html
>
> Keep what you have with the openejb-jar and add the parts described
> in this to your ejb-jar.xml.
>
> Unfortunately, while looking into this I discovered that our code
> for overriding an @EJB annotation with an <ejb-ref> in the xml is
> not implemented, thus if you have @EJB and the corresponding <ejb-
> ref> as described in the first section of the document, you'll end
> up with two refs and not one as you should.
>
> We'll get this fixed asap, but until then follow the technique
> described in the second part of the doc and in the next version of
> Geronimo you'll be able to delete some of that xml and readd the
> @EJB annotation.
>
> -David
>
>
>
> On Sep 13, 2007, at 6:58 AM, 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.buildConfigurati
>> on(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
>> --
>> View this message in context: http://www.nabble.com/Problem-with-
>> referencing-to-beans-from-other-ejb-jars-tf4435740s134.html#a12654889
>> Sent from the Apache Geronimo - Users mailing list archive at
>> Nabble.com.
>>
>>
>
Re: Problem with referencing to beans from other ejb-jars
Posted by David Blevins <da...@visi.com>.
On Sep 14, 2007, at 7:52 AM, Tomasz Mazan wrote:
>
> I found, that JARFILE#BeanName allow to refer to independent jars,
> but...
> it's still not working
It should definitely work. I'll try it myself in an example to make
sure and post the example. Probably won't be able to get to that
till monday though.
-David
Re: Problem with referencing to beans from other ejb-jars
Posted by Tomasz Mazan <wi...@wp.pl>.
David Blevins wrote:
>
>
> On Sep 14, 2007, at 7:52 AM, Tomasz Mazan wrote:
>
>>
>> I found, that JARFILE#BeanName allow to refer to independent jars,
>> but...
>> it's still not working
>
> Just to make sure, your ejb jar files are in the same ear file right?
>
> -David
>
>
>
No, there are deployed separately. JAR that contains interesting beans is
deployed out of EAR, which wants to get them.
Beniamin
--
View this message in context: http://www.nabble.com/Problem-with-referencing-to-beans-from-other-ejb-jars-tf4435740s134.html#a12724803
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Problem with referencing to beans from other ejb-jars
Posted by David Blevins <da...@visi.com>.
On Sep 14, 2007, at 7:52 AM, Tomasz Mazan wrote:
>
> I found, that JARFILE#BeanName allow to refer to independent jars,
> but...
> it's still not working
Just to make sure, your ejb jar files are in the same ear file right?
-David
Re: Problem with referencing to beans from other ejb-jars
Posted by Tomasz Mazan <wi...@wp.pl>.
I found, that JARFILE#BeanName allow to refer to independent jars, but...
it's still not working
--
View this message in context: http://www.nabble.com/Problem-with-referencing-to-beans-from-other-ejb-jars-tf4435740s134.html#a12676579
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Problem with referencing to beans from other ejb-jars
Posted by Tomasz Mazan <wi...@wp.pl>.
David Blevins wrote:
>
> Hi Tomasz,
>
> I created a doc for you that describes the missing parts.
>
> http://cwiki.apache.org/OPENEJB/ejb-refs.html
>
> Keep what you have with the openejb-jar and add the parts described
> in this to your ejb-jar.xml.
>
> Unfortunately, while looking into this I discovered that our code for
> overriding an @EJB annotation with an in the xml is not
> implemented, thus if you have @EJB and the corresponding as
> described in the first section of the document, you'll end up with
> two refs and not one as you should.
>
> We'll get this fixed asap, but until then follow the technique
> described in the second part of the doc and in the next version of
> Geronimo you'll be able to delete some of that xml and readd the @EJB
> annotation.
>
> -David
>
>
David, this example doesn't want working.
I found text below in ejb-jar specification:
The ejb-link element is used in the ejb-ref element to specify that an
EJB reference is linked to another enterprise bean in the ejb-jar
file.
The value of the ejb-link element must be the ejb-name of an enterprise
bean in the same ejb-jar file, or in another ejb-jar file in the same
J2EE application unit.
I suspect it's not correct way :-|
Beniamin
--
View this message in context: http://www.nabble.com/Problem-with-referencing-to-beans-from-other-ejb-jars-tf4435740s134.html#a12676146
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Problem with referencing to beans from other ejb-jars
Posted by David Blevins <da...@visi.com>.
Hi Tomasz,
I created a doc for you that describes the missing parts.
http://cwiki.apache.org/OPENEJB/ejb-refs.html
Keep what you have with the openejb-jar and add the parts described
in this to your ejb-jar.xml.
Unfortunately, while looking into this I discovered that our code for
overriding an @EJB annotation with an <ejb-ref> in the xml is not
implemented, thus if you have @EJB and the corresponding <ejb-ref> as
described in the first section of the document, you'll end up with
two refs and not one as you should.
We'll get this fixed asap, but until then follow the technique
described in the second part of the doc and in the next version of
Geronimo you'll be able to delete some of that xml and readd the @EJB
annotation.
-David
On Sep 13, 2007, at 6:58 AM, 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.buildConfiguratio
> n(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
> --
> View this message in context: http://www.nabble.com/Problem-with-
> referencing-to-beans-from-other-ejb-jars-tf4435740s134.html#a12654889
> Sent from the Apache Geronimo - Users mailing list archive at
> Nabble.com.
>
>