[jboss-user] [EJB/JBoss] - Re: Serializable no remote classloading

enriqueam do-not-reply at jboss.com
Thu May 28 10:57:39 EDT 2009


Hello there,

I'm running JBoss 4.2.3 GA default server (no mods) and have a EJB 2.1 bean deployed in it. Have created a stand-alone remote client to access the bean.

The client tries to do exactly the same as discussed in this post, that is, it only depends the jar file containing the bean interfaces (plus jbossall-client.jar of course), and it expects to be able to dynamically load the implementation classes from the server.

This worked on jboss 4.0.4. However, to get it working on 4.2.3 I had to add 


  |          <invoker-bindings>
  |             <invoker>
  |                <invoker-proxy-binding-name>stateless-rmi-invoker</invoker-proxy-binding-name>
  |                <jndi-name>DummySessionBean</jndi-name>
  |             </invoker>
  |          </invoker-bindings>
  | 

to jboss.xml

If I don't, I have no problem at all accessing the home interface, nor at executing any methods from it, but as soon as the client has to load one of the implementation classes from the server it throws a ClassNotFoundException


  | java.lang.reflect.UndeclaredThrowableException
  | 	at $Proxy1.makeKnife(Unknown Source)
  | 	at com.sysmech.ijamclient.IjamClient.execute(IjamClient.java:75)
  | 	at com.sysmech.ijamclient.Main.main(Main.java:59)
  | Caused by: java.lang.ClassNotFoundException: com.dummy.KnifeImpl
  | 	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
  | 	at java.security.AccessController.doPrivileged(Native Method)
  | 	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
  | 	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
  | 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
  | 	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
  | 	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
  | 	at java.lang.Class.forName0(Native Method)
  | 	at java.lang.Class.forName(Class.java:242)
  | 	at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:585)
  | 	at org.jboss.invocation.MarshalledValueInputStream.resolveClass(MarshalledValueInputStream.java:109)
  | 	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544)
  | 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
  | 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
  | 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
  | 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
  | 	at org.jboss.invocation.MarshalledValue.get(MarshalledValue.java:91)
  | 	at org.jboss.invocation.unified.interfaces.UnifiedInvokerProxy.invoke(UnifiedInvokerProxy.java:196)
  | 	at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
  | 	at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
  | 	at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
  | 	at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
  | 	at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
  | 	at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
  | 

The bean method the client is trying to execute looks like:


  |    public Knife makeKnife()
  |    {
  |       return new KnifeImpl();
  |    }
  | 

Being Knife the interface that is available to both the server and the client, and KnifeImpl the implementation class only available to the server.

In post dated on the Sat Jan 12, 2008 12:12 PM by newtetris, it was confirmed the problem described in this post did not show for EJB 2. Could anyone explain how to achieve that without having to change the invoker in jboss.xml?

Cheers,
Enrique.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233934#4233934

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4233934



More information about the jboss-user mailing list