geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <david.blev...@visi.com>
Subject Re: Problem with referencing to beans from other ejb-jars
Date Thu, 13 Sep 2007 19:54:09 GMT
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.
>
>


Mime
View raw message