dlinsin
Jun 3rd, 2008, 08:40 AM
Hi there,
I have a Bundle A which uses a Service defined by a Spring-Bean using a RmiProxyFactoryBean. The Service runs on a remote server. I have a Bundle B which contains business object, which are being used by Bundle A (Import-Package) and the remote Service.
When Bundle A calls the remote Service, the remote method is being called and the Service returns the business object. However, when it's being unmarshalled, I get the following Exception:
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: Vertrieb (no security manager: RMI class loader disabled)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:1 78)
at org.springframework.remoting.rmi.RmiInvocationWrap per_Stub.invoke(Unknown Source)
at org.springframework.remoting.rmi.RmiClientIntercep tor.doInvoke(RmiClientInterceptor.java:393)
at org.springframework.remoting.rmi.RmiClientIntercep tor.doInvoke(RmiClientInterceptor.java:339)
at org.springframework.remoting.rmi.RmiClientIntercep tor.invoke(RmiClientInterceptor.java:258)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy7.readAll(Unknown Source)
at
....
Caused by: java.lang.ClassNotFoundException: Vertrieb (no security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandl er.java:375)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandl er.java:165)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClas sLoader.java:620)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassL oader.java:247)
at sun.rmi.server.MarshalInputStream.resolveClass(Mar shalInputStream.java:197)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1575)
at java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:351)
at java.util.ArrayList.readObject(ArrayList.java:593)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeReadObject(ObjectS treamClass.java:974)
at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1846)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:351)
at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRe f.java:306)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:1 55)
... 96 more
Now I introduced another Bundle B, which wraps a Proxy around the remote Service and simply delegates all calls to the Service. I exposed the interface of Bundle B using osgi:service. Bundle A simply references this service using osgi:reference. Now Bundle A calls Bundle B, which then calls the remote Service and the funny thing is, it works. No Exception!
Any ideas or comments? I suppose it's a classloader issues....
I have a Bundle A which uses a Service defined by a Spring-Bean using a RmiProxyFactoryBean. The Service runs on a remote server. I have a Bundle B which contains business object, which are being used by Bundle A (Import-Package) and the remote Service.
When Bundle A calls the remote Service, the remote method is being called and the Service returns the business object. However, when it's being unmarshalled, I get the following Exception:
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: Vertrieb (no security manager: RMI class loader disabled)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:1 78)
at org.springframework.remoting.rmi.RmiInvocationWrap per_Stub.invoke(Unknown Source)
at org.springframework.remoting.rmi.RmiClientIntercep tor.doInvoke(RmiClientInterceptor.java:393)
at org.springframework.remoting.rmi.RmiClientIntercep tor.doInvoke(RmiClientInterceptor.java:339)
at org.springframework.remoting.rmi.RmiClientIntercep tor.invoke(RmiClientInterceptor.java:258)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy7.readAll(Unknown Source)
at
....
Caused by: java.lang.ClassNotFoundException: Vertrieb (no security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandl er.java:375)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandl er.java:165)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClas sLoader.java:620)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassL oader.java:247)
at sun.rmi.server.MarshalInputStream.resolveClass(Mar shalInputStream.java:197)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1575)
at java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:351)
at java.util.ArrayList.readObject(ArrayList.java:593)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeReadObject(ObjectS treamClass.java:974)
at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1846)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:351)
at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRe f.java:306)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:1 55)
... 96 more
Now I introduced another Bundle B, which wraps a Proxy around the remote Service and simply delegates all calls to the Service. I exposed the interface of Bundle B using osgi:service. Bundle A simply references this service using osgi:reference. Now Bundle A calls Bundle B, which then calls the remote Service and the funny thing is, it works. No Exception!
Any ideas or comments? I suppose it's a classloader issues....