Hi it seems I have the same issue. I have to call remote EJB 3 session bean but in my case EJB 3 session bean is deployed on JBoss 5.1 and it is invoked from JBoss 4.2.3GA server. Invocation is wrapped in JAR lib with all JBoss 5.1 client libs (client libs are repacked). The lib is in /jboss-4.2.3.GA/server/all/deploy/lib. When I call session bean on JBoss 5.1 I got:
010-09-21 16:35:01,132 DEBUG [org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory] org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory servicing request for AdServiceGate
2010-09-21 16:35:01,188 DEBUG [org.jboss.remoting.transport.socket.MicroSocketClientInvoker] SocketClientInvoker[18b1699, socket://AZINCHENKO-WS1:3873] constructed
2010-09-21 16:35:01,189 DEBUG [org.jboss.remoting.MicroRemoteClientInvoker] SocketClientInvoker[18b1699, socket://AZINCHENKO-WS1:3873] connecting
2010-09-21 16:35:01,189 DEBUG [org.jboss.remoting.transport.socket.MicroSocketClientInvoker] Creating semaphore with size 50
2010-09-21 16:35:01,189 DEBUG [org.jboss.remoting.MicroRemoteClientInvoker] SocketClientInvoker[18b1699, socket://AZINCHENKO-WS1:3873] connected
2010-09-21 16:35:01,374 DEBUG [org.jboss.remoting.transport.socket.ClientSocketWrapper] reset timeout: 0
2010-09-21 16:35:01,631 DEBUG [org.jboss.remoting.InvokerRegistry] removed SocketClientInvoker[18b1699, socket://AZINCHENKO-WS1:3873] from registry
2010-09-21 16:35:01,631 DEBUG [org.jboss.remoting.transport.socket.MicroSocketClientInvoker] SocketClientInvoker[18b1699, socket://AZINCHENKO-WS1:3873] disconnecting ...
2010-09-21 16:35:01,632 DEBUG [org.jboss.remoting.transport.socket.SocketWrapper] ClientSocketWrapper[Socket[addr=/192.168.20.82,port=3873,localport=54601].1ef0b44] closing
2010-09-21 16:35:01,632 DEBUG [org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory] Created Proxy of type $Proxy97 for EJB3 Business Interface: com.webvoice.advertizing.common.sbt.ServiceGate
2010-09-21 16:35:01,638 DEBUG [org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase] Couldn't handle invocation directly within org.jboss.ejb3.proxy.impl.handler.session.SessionRemoteProxyInvocationHandler@175beef: Current invocation "public abstract java.lang.Object com.webvoice.advertizing.common.sbt.ServiceGate.invokeMethodByHash(java.lang.String,java.lang.Object[]) throws java.lang.Throwable" is not eligible for direct handling by org.jboss.ejb3.proxy.impl.handler.session.SessionRemoteProxyInvocationHandler@175beef
2010-09-21 16:35:01,686 DEBUG [com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager] PropagationContextManager.getTransactionPropagationContext - called
2010-09-21 16:35:01,687 DEBUG [org.jboss.remoting.transport.socket.MicroSocketClientInvoker] SocketClientInvoker[10bfedd, socket://AZINCHENKO-WS1:3873] constructed
2010-09-21 16:35:01,687 DEBUG [org.jboss.remoting.MicroRemoteClientInvoker] SocketClientInvoker[10bfedd, socket://AZINCHENKO-WS1:3873] connecting
2010-09-21 16:35:01,687 DEBUG [org.jboss.remoting.transport.socket.MicroSocketClientInvoker] Creating semaphore with size 50
2010-09-21 16:35:01,687 DEBUG [org.jboss.remoting.MicroRemoteClientInvoker] SocketClientInvoker[10bfedd, socket://AZINCHENKO-WS1:3873] connected
2010-09-21 16:35:01,841 DEBUG [org.jboss.remoting.transport.socket.ClientSocketWrapper] reset timeout: 0
2010-09-21 16:35:01,892 DEBUG [org.jboss.remoting.InvokerRegistry] removed SocketClientInvoker[10bfedd, socket://AZINCHENKO-WS1:3873] from registry
2010-09-21 16:35:01,892 DEBUG [org.jboss.remoting.transport.socket.MicroSocketClientInvoker] SocketClientInvoker[10bfedd, socket://AZINCHENKO-WS1:3873] disconnecting ...
2010-09-21 16:35:01,892 DEBUG [org.jboss.remoting.transport.socket.SocketWrapper] ClientSocketWrapper[Socket[addr=/192.168.20.82,port=3873,localport=54602].dad6d0] closing
2010-09-21 16:35:01,896 INFO [STDOUT] java.lang.IllegalStateException: Unexpected server exception: java.lang.NullPointerException
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:379)
at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
As I can see I found my remote object (Created Proxy of type $Proxy97 for EJB3 Business Interface: com.webvoice.advertizing.common.sbt.ServiceGate) and invoke method on it and then got this(2010-09-21 16:35:01,638 DEBUG [org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase] Couldn't handle invocation directly within org.jboss.ejb3.proxy.impl.handler.session.SessionRemoteProxyInvocationHandler@175beef: Current invocation "public abstract java.lang.Object com.webvoice.advertizing.common.sbt.ServiceGate.invokeMethodByHash(java.lang.String,java.lang.Object[]) throws java.lang.Throwable" is not eligible for direct handling by org.jboss.ejb3.proxy.impl.handler.session.SessionRemoteProxyInvocationHandler@175beef)
So I can test my lib from standalone application - it successfully invoke EJB 3 session bean is deployed on JBoss 5.1
I guess the problem is in client libs conflict. I tryed to put JBoss 5.1 client libs in /jboss-4.2.3.GA/server/all/deploy/lib (in the same dir as my lib is) and point my lib to them by specifying Class-Path attribute in manifest file for my JAR - without result.
Now I am looking in http://community.jboss.org/wiki/JBossClassLoadingUseCases but without optimism, after a lot of time spending with the problem. All I found in internet do not contain solution and common advice is to put all under the same version of JBoss. But I can not. So it will be possible to do one thing - direct Socket