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.

[3314 byte] By [PS_csa] at [2007-10-3 11:29:40]
# 1

We had this problem as well. It was unbelievable, but it was really due to the fact that Tomcat was installed in "C:\Program Files\Tomcat" and that the "Program Files" folder contained spaces. So, the solution was quite simple: reinstalled Tomcat in a folder without spaces and the problem was gone.

I think that telling Tomcat to use a newer JDK could also solve the problem. However, I am not 100% sure for this.

Regards,

Miran

MiranMa at 2007-7-15 13:56:08 > top of Java-index,Core,Core APIs...