v a [
http://community.jboss.org/people/hipa] created the discussion
"Dynamic classloading issue"
To view the discussion, visit:
http://community.jboss.org/message/545546#545546
--------------------------------------------------------------
I'm using Remoting 2.5.2.SP3 with JBoss 6.0.M3. Remote class loading works only for
some common classes but not for my beans. I have a simple bean with remote interface. When
I try accessing it by InitialContext.lookup the exception occurs:
org.jboss.ejb3.proxy.impl.objectfactory.session.stateless.StatelessSessionProxyObjectFactory.getProxy(StatelessSessionProxyObjectFactory.java:79)
at
org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:161)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1483)
at
org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1500)
... 4 more
Caused by: java.lang.ClassNotFoundException: *** my bean remote interface ***
at
org.jboss.remoting.serialization.ClassLoaderUtility.loadClass(ClassLoaderUtility.java:103)
at
org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:93)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at
org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveProxyClass(ObjectInputStreamWithClassLoader.java:253)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1531)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at
org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:119)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at
org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObjectVersion2_2(JavaSerializationManager.java:238)
at
org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:138)
at
org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:123)
at
org.jboss.remoting.transport.socket.MicroSocketClientInvoker.versionedRead(MicroSocketClientInvoker.java:1299)
at
org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:907)
at
org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:167)
at org.jboss.remoting.Client.invoke(Client.java:1927)
at org.jboss.remoting.Client.invoke(Client.java:770)
at
org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at
org.jboss.ejb3.proxy.impl.remoting.IsLocalProxyFactoryInterceptor.invoke(IsLocalProxyFactoryInterceptor.java:104)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
at $Proxy0.createProxyBusiness(Unknown Source)
at
org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:129)
at
org.jboss.ejb3.proxy.impl.objectfactory.session.stateless.StatelessSessionProxyObjectFactory.getProxy(StatelessSessionProxyObjectFactory.java:79)
at
org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:161)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1483)
at
org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1500)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:824)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
...
In the server log there are some odd things:
13:36:31,971 DEBUG [org.jboss.remoting.marshal.MarshallerLoaderHandler]
MarshallerLoaderHandler: loading class: *** my bean remote interface ***
13:36:31,978 TRACE [org.jboss.remoting.loading.ClassUtil] trying to load class: *** my
bean remote interface *** from path: *** my bean remote interface class ***
13:36:31,980 TRACE [org.jboss.remoting.loading.ClassByteClassLoader] getResourceAsStream
=>*** my bean remote interface *** = null
13:36:31,982 DEBUG [org.jboss.remoting.marshal.MarshallerLoaderHandler] unable to load
class *** my bean remote interface ***
13:36:31,983 DEBUG [org.jboss.remoting.marshal.MarshallerLoaderHandler]
MarshallerLoaderHandler: returning class: *** my bean remote interface ***: ClassBytes
[class=*** my bean remote interface ***,value=null]
13:36:31,983 TRACE [org.jboss.remoting.transport.socket.ServerThread]
SocketServerInvoker[ip:4873].invoke() returned ClassBytes [class=*** my bean remote
interface ***,value=null]
13:36:31,983 TRACE [org.jboss.remoting.transport.socket.ServerThread] creating response
instance
I also checked that the remote class loading works at all (I removed some client jars from
my client, the missing classes were successfully loaded):
13:43:36,402 DEBUG [org.jboss.remoting.marshal.MarshallerLoaderHandler]
MarshallerLoaderHandler: loading class:
org.jboss.ejb3.security.client.SecurityClientInterceptor
13:43:36,402 TRACE [org.jboss.remoting.loading.ClassUtil] trying to load class:
org.jboss.ejb3.security.client.SecurityClientInterceptor from path:
org/jboss/ejb3/security/client/SecurityClientInterceptor.class
13:43:36,403 TRACE [org.jboss.remoting.loading.ClassByteClassLoader] getResourceAsStream
=>org.jboss.ejb3.security.client.SecurityClientInterceptor = null
13:43:36,403 TRACE [org.jboss.remoting.loading.ClassUtil] looking for classes at:
ClassByteClassLoader [{}]
13:43:36,403 TRACE [org.jboss.remoting.loading.ClassUtil] found class at classloader:
ClassByteClassLoader [{}]
13:43:36,403 DEBUG [org.jboss.remoting.marshal.MarshallerLoaderHandler]
MarshallerLoaderHandler: returning class:
org.jboss.ejb3.security.client.SecurityClientInterceptor: ClassBytes
[class=org.jboss.ejb3.security.client.SecurityClientInterceptor,value=[B@90f268]
13:43:36,403 TRACE [org.jboss.remoting.transport.socket.ServerThread]
SocketServerInvoker[ip:4873].invoke() returned ClassBytes
[class=org.jboss.ejb3.security.client.SecurityClientInterceptor,value=[B@90f268]
13:43:36,404 TRACE [org.jboss.remoting.transport.socket.ServerThread] creating response
instance
Then I tried to get rid of an isolated class loader for my EAR but the following exception
occurs in that case:
...
Caused by: java.lang.RuntimeException: Can not find interface declared by Proxy in our CL
+ sun.misc.Launcher$AppClassLoader@1a16869
at
org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.redefineProxyInTcl(ProxyObjectFactory.java:410)
at
org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:134)
at
org.jboss.ejb3.proxy.impl.objectfactory.session.stateless.StatelessSessionProxyObjectFactory.getProxy(StatelessSessionProxyObjectFactory.java:79)
at
org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:161)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1483)
at
org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1500)
... 4 more
Caused by: java.lang.ClassNotFoundException: *** my bean remote interface ***
...
Any suggestions?
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/545546#545546]
Start a new discussion in JBoss Remoting at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]