Details
-
Bug
-
Resolution: Can't Do
-
Major
-
None
-
JBossAS-4.0.4.GA
-
None
Description
There is a problem during the lookup between two ejb when I configure Isolation classloding for the ears
I have configured all ears to be in isolated classloader spaces and using call by value for remote interface.
the configuration file deploy/ear-deployer.xml contains :
Code:
<mbean code="org.jboss.deployment.EARDeployer"
name="jboss.j2ee:service=EARDeployer">
<!-- A flag indicating if ear deployments should have their own scoped
class loader to isolate their classes from other deployments.
-->
<attribute name="Isolated">true</attribute>
<!-- A flag indicating if the ear components should have in VM call
optimization disabled.
-->
<attribute name="CallByValue">true</attribute>
</mbean>
I have deployed one ear that contains two ejbs : ejbA and ejbB;
the ejbA calls the ejbB in the same way :
Code:
Context initCtx = new InitialContext();
Context ejbCtx = (Context)initCtx.lookup("java:comp/env/ejb");
Object objRef = ejbCtx.lookup("MyStatless");
System.out.println("++++ objRef Classloader = "+objRef.getClass().getClassLoader().toString());
System.out.println("++++ MyStatlessHome Classloader = "+MyStatlessHome.class.getClassLoader().toString());
home = (MyStatlessHome)PortableRemoteObject.narrow(objRef, MyStatlessHome.class);
MyStatless clientStatless = (MyStatless)home.create();
and I have configured ejb-ref in ejb.jar.xml :
Code:
<ejb-ref >
<ejb-ref-name>ejb/MyStatless</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>it.csi.oss.clusterejb.interfaces.MyStatlessHome</home>
<remote>it.csi.oss.clusterejb.interfaces.MyStatless</remote>
</ejb-ref>
and in jboss.xml :
Code:
<ejb-ref>
<ejb-ref-name>ejb/MyStatless</ejb-ref-name>
<jndi-name>jnp://cst001.csi.it:1100/ejb/MyStatlessClient</jndi-name>
</ejb-ref>
unfortunately I obtain following exception :
2006-06-06 13:57:01,223 INFO [STDOUT] ++++ objRef Classloader = org.jboss.util.loading.DelegatingClassLoader@114e777
2006-06-06 13:57:01,224 INFO [STDOUT] ++++ MyStatlessHome Classloader = org.jboss.mx.loading.UnifiedClassLoader3@27f394
2006-06-06 13:57:01,225 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException in method: public abstract java.lang.String it.csi.oss.clusterejb.interfaces.MyStatlessClient.getNome(java.lang.String,int) throws java.rmi.RemoteException:
java.lang.ClassCastException
at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
at it.csi.oss.clusterejb.ejb.MyStatlessClient.getNome(MyStatlessClient.java:154)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
at org.jboss.ws.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:64)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:954)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:819)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:420)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java: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)
as you can see the two classloder are different :
2006-06-06 13:57:01,223 INFO [STDOUT] ++++ objRef Classloader = org.jboss.util.loading.DelegatingClassLoader@114e777
2006-06-06 13:57:01,224 INFO [STDOUT] ++++ MyStatlessHome Classloader = org.jboss.mx.loading.UnifiedClassLoader3@27f394
Tanks
Davide Pasquero