0 Replies Latest reply on May 24, 2006 8:36 AM by davide pasquero

    lookup problem between ejb inside an ear with Isolation clas

    davide pasquero Newbie

      I have 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 :

       <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 :
       Context initCtx = new InitialContext();
       Context ejbCtx = (Context)initCtx.lookup("java:comp/env/ejb");
       Object objRef = ejbCtx.lookup("MyStatless");
       home = (MyStatlessHome)PortableRemoteObject.narrow(objRef, MyStatlessHome.class);
       MyStatless clientStatless = (MyStatless)home.create();
      

      and I have configured ejb-ref in ejb.jar.xml :

       <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 :

       <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-05-24 12:31:04,669 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.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
      at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
      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:324)
      at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
      at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
      at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      at org.jboss.ejb.Container.invoke(Container.java:873)
      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:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

      ....


      can you help me?

      Tanks
      Davide Pasquero