I have a problem with a simple RMI server/client test. It works fine if I start the server and client via main methods (I can see my port is listening in netstat).
If I start the server via tomcat it seems like everything is ok, but when I run my client I get the following exception on client side lookup:
java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.net.MalformedURLException: no protocol: Files at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source) at java.rmi.Naming.lookup(Unknown Source) at com.deucemedia.common.rmi.TestRmiClient.init(TestRmiClient.java:42) at com.deucemedia.common.rmi.TestRmiClient.<clinit>(TestRmiClient.java:19) Caused by: java.net.MalformedURLException: no protocol: Files at java.net.URL.<init>(Unknown Source) at java.net.URL.<init>(Unknown Source) at java.net.URL.<init>(Unknown Source) at sun.rmi.server.LoaderHandler.pathToURLs(Unknown Source) at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source) at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source) at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source) at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source) at java.io.ObjectInputStream.readProxyDesc(Unknown Source) at java.io.ObjectInputStream.readClassDesc(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) ... 4 more
Server code: private static final int serverPort=20000; private static final String regLookup="RmiExecuteUtilServer"; ... Registry registry = LocateRegistry.createRegistry(serverPort); registry.rebind(regLookup,this);
Personally, while it's not OK to cross-post to multiple JavaRanch forums, I think it's OK to cross-post to completely different bulletin boards, like JGuru. It is nice to say you've done so, to save others' time.
Sorry, I haven't done RMI for ages (just CORBA), so can't help with your actual problem.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Joined: Aug 29, 2007
Problem solved... I changed the tomcat installation directory so it didn't have any spaces in it. /J