-
Jul 10th, 2008, 08:37 AM
#1
Using RMI on the Spring Application Platform
Hello
I'm having some problems using Spring RMI services in combination with the Spring Application Platform.
Well I can publish the service and access it from my Eclipse RCP client (using Spring DM), I can transfer simple Strings but as soon as I try to get or send an Object I get the following exceptions on my client:
When sending:
org.springframework.remoting.RemoteAccessException : Could not access remote service [rmi://localhost:1195/TestService]; nested exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: com.blogspot.swissdev.servicetest.TestObject in PlatformBundleClassLoader: [bundle=org.springframework.context_2.5.5.BUILD-20080530] (no security manager: RMI class loader disabled)
at org.springframework.remoting.rmi.RmiClientIntercep torUtils.convertRmiAccessException(RmiClientInterc eptorUtils.java:181)
at org.springframework.remoting.rmi.RmiClientIntercep tor.doInvoke(RmiClientInterceptor.java:342)
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 $Proxy2.setObject(Unknown Source)
.........
When receiving:
org.springframework.remoting.RemoteAccessException : Could not access remote service [rmi://localhost:1195/TestService]; nested exception is java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: com.blogspot.swissdev.servicetest.TestObject (no security manager: RMI class loader disabled)
at org.springframework.remoting.rmi.RmiClientIntercep torUtils.convertRmiAccessException(RmiClientInterc eptorUtils.java:181)
at org.springframework.remoting.rmi.RmiClientIntercep tor.doInvoke(RmiClientInterceptor.java:342)
at org.springframework.remoting.rmi.RmiClientIntercep tor.invoke(RmiClientInterceptor.java:258)
...........
On the server I have one simple Bundle Project, importing the library org.springframework.spring and exporting the package with the business object in it.
My RCP client is one simple RCP example plug-in (the one with a view), including the Spring DM plug-ins in the launch.
Spring DM is launched and I access the service when double clicking on a item in the view, so everything is loaded.
Here my access to the service:
ITestService service = Activator.getDefault().getService(ITestService.cla ss.getName());
System.out.println(service.getTestString());
service.setObject(new TestObject());
service.getObject();
Here the getService method:
public <T> T getService(String serviceClassName) {
ServiceReference reference = context.getServiceReference(serviceClassName);
if ( reference != null ) {
Object service = context.getService(reference);
if ( service != null )
return (T) service;
}
throw new RuntimeException("Service not found in the registry.");
}
The print of getTestString works and the other calls fail.
Did anybody have the same exception or any clue why org.springframework.context doesn't see my object?
Thanks for any help!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules