Error accessing RMI from servlet
Issue I am facing is not accessing rmi's from servlets but seems like the special classes that I am using and am keeping it in a special folder...
Apache-Tomcat installed in
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps
In my context root
myRoot\WEB-INF\classes\
I have my servlets1.class, servlets2.class along with
rmiInterface1.class rmiInterface1Impl_stub.class
rmiInterface2.class rmiInterface2Imple_stub.class
and a myUtil folder with serializable1.class and serializable2.class which are the classes that I receive from applet communicating withthis servlets and these servlets send to the rmi's back and forth.
When I run the application:
rmi's first (registry and then the 2 rmi servers)
tomcat second
applet third (using policy file)
I get following error:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.net.MalformedURLException: no protocol: Files/Apache
From what I have read so far - it state that my apache might be installed in the wrong directory and all and that it doesn't take spaces. However, at no point in my code I am using the file path to access url.
My applet connects to servlets using:
URL url =new URL("http://localhost:8080/myroot/Servlet1");
URLConnection uc = url.openConnection();
uc.setDoOutput(true);
uc.setDoInput(true);
uc.setRequestProperty("Content-type","application/x-java-serialized-object");
OutputStream os = uc.getOutputStream();
ObjectOutputStream out =new ObjectOutputStream(os);
out.writeObject(lrOut);
// get response back
ObjectInputStream in =new ObjectInputStream(uc.getInputStream());
lrIn = (LoginRequest)in.readObject();
out.flush();
in.close();
out.close();
And my servlets communicate with rmi's using:
String remoteServiceName =new String ("rmi://localhost/RMIInterface");
try
{
RMIInterface rmi = (RMIInterface) Naming.lookup(remoteServiceName);
return (rmi.methodInRMI(serialize1));
}
catch (Exception e)
{
// the above try block is where it breaks and comes here
}
The 2 rmi's that I have use the exact name to rebind also.
My guess is that the only place I could have the error coming in is in the servlets part where trying to access myUtil folder it encounters a file path with spaces in it.
However, I don't know how to fix it.
Can someone please help.
Thanx in advance.

