1 Reply Latest reply on Aug 12, 2004 2:49 AM by Tom Elrod

    ClassLoader problem - Very Urgent

    Rama Krishna Tummala Newbie

      Hi,
      I am struck up with a problem with class loader. I was porting my product from WebLogic to JBoss. The scenario is like this :

      My product basically has a client and the server operating at remote machines. The Server provides an interface which is a remote object .
      This interface is implemented by the client .

      This callbackobject (implemented by the client) is passed as an input parameter to one of the methods of a Session Bean.
      When the client calls this method, the server throws...

      java.lang.ClassNotFoundException: x.y.sample

      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.net.URLClassLoader$1.run(URLClassLoa
      der.java:199)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.security.AccessController.doPrivileg
      ed(Native Method)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.net.URLClassLoader.findClass(URLClas
      sLoader.java:187)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.lang.ClassLoader.loadClass(ClassLoad
      er.java:289)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.lang.ClassLoader.loadClass(ClassLoad
      er.java:235)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.invocation.MarshalledValueInput
      Stream.resolveClass(MarshalledValueInputStream.java:85)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.io.ObjectInputStream.readNonProxyDes
      c(ObjectInputStream.java:1513)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.io.ObjectInputStream.readClassDesc(O
      bjectInputStream.java:1435)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.io.ObjectInputStream.readOrdinaryObj
      ect(ObjectInputStream.java:1626)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.io.ObjectInputStream.readObject0(Obj
      ectInputStream.java:1274)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.io.ObjectInputStream.readArray(Objec
      tInputStream.java:1603)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.io.ObjectInputStream.readObject0(Obj
      ectInputStream.java:1271)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.io.ObjectInputStream.readObject(Obje
      ctInputStream.java:324)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.invocation.MarshalledValue.get(
      MarshalledValue.java:78)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.invocation.MarshalledInvocation
      .getArguments(MarshalledInvocation.java:324)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.ejb.StatelessSessionContainer$C
      ontainerInterceptor.invoke(StatelessSessionContainer.java:629)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.resource.connectionmanager.Cach
      edConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.ejb.plugins.StatelessSessionIns
      tanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.ejb.plugins.AbstractTxIntercept
      or.invokeNext(AbstractTxInterceptor.java:84)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.ejb.plugins.TxInterceptorCMT.ru
      nWithTransactions(TxInterceptorCMT.java:243)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.ejb.plugins.TxInterceptorCMT.in
      voke(TxInterceptorCMT.java:104)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.ejb.plugins.SecurityInterceptor
      .invoke(SecurityInterceptor.java:117)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.ejb.plugins.LogInterceptor.invo
      ke(LogInterceptor.java:191)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.ejb.plugins.ProxyFactoryFinderI
      nterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.ejb.StatelessSessionContainer.i
      nternalInvoke(StatelessSessionContainer.java:322)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.ejb.Container.invoke(Container.
      java:674)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at sun.reflect.GeneratedMethodAccessor40.inv
      oke(Unknown Source)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at sun.reflect.DelegatingMethodAccessorImpl.
      invoke(DelegatingMethodAccessorImpl.java:25)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.lang.reflect.Method.invoke(Method.ja
      va:324)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.mx.capability.ReflectedMBeanDis
      patcher.invoke(ReflectedMBeanDispatcher.java:284)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.mx.server.MBeanServerImpl.invok
      e(MBeanServerImpl.java:549)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at org.jboss.invocation.jrmp.server.JRMPInvo
      ker.invoke(JRMPInvoker.java:359)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at sun.reflect.GeneratedMethodAccessor42.inv
      oke(Unknown Source)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at sun.reflect.DelegatingMethodAccessorImpl.
      invoke(DelegatingMethodAccessorImpl.java:25)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.lang.reflect.Method.invoke(Method.ja
      va:324)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at sun.rmi.server.UnicastServerRef.dispatch(
      UnicastServerRef.java:261)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at sun.rmi.transport.Transport$1.run(Transpo
      rt.java:148)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.security.AccessController.doPrivileg
      ed(Native Method)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at sun.rmi.transport.Transport.serviceCall(T
      ransport.java:144)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at sun.rmi.transport.tcp.TCPTransport.handle
      Messages(TCPTransport.java:460)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at sun.rmi.transport.tcp.TCPTransport$Connec
      tionHandler.run(TCPTransport.java:701)
      ERROR [RMI TCP Connection(1)-10.18.8.178] (?:?) - at java.lang.Thread.run(Thread.java:534)


      some where , i came to know that jboss uses the URLClassLoader concept and that it has a ClassLoaderRepository. I tried to invoke the classLoader, but it doesnot reach that part of the code. Once the call comes to the EJB Container , it throws exception.

      In some other documentation....this mbean is said to be put in jboss-service.xml file.


      <mbean code="org.jboss.remoting.transport.Connector"
      xmbean-dd="org/jboss/remoting/transport/Connector.xml"
      name="jboss.remoting:service=Connector,transport=Socket"
      display-name="Socket transport Connector">

      socket://localhost:8084



      <server-side>true</server-side>
      <client-side>true</client-side>


      org.jboss.mx.remoting.JMXSubsystemInvocationHandler






      But , i did not find the jar for this. So , i replaced the handler with
      org.jboss.aop.remoting.AOPRemotingInvocationHandler

      and checked. when server is started, It says handler not found ....hence quitting.

      Then, i have put the above tags . It shows no error but my purpose was not solved.

      In some other documentation , i found that .....
      these tags in jboss-web.xml should be changed.
      <class-loading>
      <loader-repository>
      weta:confluence=LoaderRepository
      <loader-repository-config>
      java2ParentDelegation=true
      </loader-repository-config>
      </loader-repository>
      </class-loading>

      I have changed true to false. But in vain, my problem is still not solved.
      I am using jboss-3.2.1 and j2skd1.4.2. Its working fine with WebLogic.


      Any help would be highly appreciated.