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:
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!Code: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:178) at org.springframework.remoting.rmi.RmiInvocationWrapper_Stub.invoke(Unknown Source) at org.springframework.remoting.rmi.RmiClientInterceptor.doInvoke(RmiClientInterceptor.java:393) at org.springframework.remoting.rmi.RmiClientInterceptor.doInvoke(RmiClientInterceptor.java:339) at org.springframework.remoting.rmi.RmiClientInterceptor.invoke(RmiClientInterceptor.java:258) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.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(LoaderHandler.java:375) at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165) at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620) at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247) at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496) 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 java.util.ArrayList.readObject(ArrayList.java:593) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1846) 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 sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:155) ... 96 more
Any ideas or comments? I suppose it's a classloader issues....


