Bug 4543 - RMI fails if tomcat is installed in directory with white space
Summary: RMI fails if tomcat is installed in directory with white space
Status: RESOLVED WONTFIX
Alias: None
Product: Tomcat 4
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 4.0 Final
Hardware: PC other
: P3 normal with 3 votes (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-31 08:28 UTC by gax
Modified: 2004-11-16 19:05 UTC (History)
1 user (show)



Attachments
clean work-around with need for security policy input (1.16 KB, text/plain)
2004-11-11 18:04 UTC, Shawn Bertini
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gax 2001-10-31 08:28:48 UTC
i installed tomcat in c:\Program Files\Apache Tomcat 4.0
and run it as a service on Windows 2000.

when running a sevlet with RMI client code, 
i get :
----- Root Cause -----
com.juldi.jis.JISException: RemoteException: RemoteException occurred in server
thread; nested exception is: 
	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
	java.net.MalformedURLException: no protocol: Files/Apache
	at
com.juldi.jis.connector.rmi.RMIIntegrationServerProxy.newOperation(RMIIntegrationServerProxy.java:42)
......


Note the java.net.MalformedURLException: no protocol: Files/Apache
Comment 1 gax 2001-10-31 08:46:03 UTC
i also tried repacing all occurances of 'c:\Program Files\Apache Tomcat 4.0' in
my registry to 'c:\PROGRA~1\APACHE~1.0' but the problem persists.
Comment 2 Remy Maucherat 2001-10-31 11:56:42 UTC
Is it a VM local server ?
Would you have some way to print out the entire URL ? In theory, it should be a 
file based URL (with a space since the path has a space); I would have thought 
this would be supported. I didn't notice any problem 
It may be a JDK bug, or it may be that the URL needs to be encoded / decoded 
HTTP style with the usual %xx encoding.
Comment 3 gax 2001-10-31 18:13:12 UTC
this bug goes away when palcing the whole tomcat in a dir with no spaces :
"c:\tomcat" instead of "c:\Program Files\Apache Tomcat 4.0"
also, it has nothing to do with the registry (as i thought in a previous comment
since the bug is there even when i run startup.bat)

the exception occures during an rmi call unmarchalling in a rmic generated stub:
java.rmi.server.RemoteCall call = 
      ref.newCall((java.rmi.server.RemoteObject) this,
                  operations,
                  10,
                  interfaceHash);
try {
  java.io.ObjectOutput out = call.getOutputStream();
  out.writeObject($param_AuthToken_1);
  out.writeObject($param_String_2);
  out.writeObject($param_String_3);
} catch (java.io.IOException e) {
  throw new java.rmi.MarshalException("error marshalling arguments", e);
}

the best stacktrace i could get was:
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
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
        java.net.MalformedURLException: no protocol: Files/Apache
java.net.MalformedURLException: no protocol: Files/Apache
        at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
        at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
        at sun.rmi.server.UnicastRef.invoke(Unknown Source)
        at
com.juldi.jis.is.rmi.RMIConnectorReceiver_Stub.newOperation(RMIConnectorReceiver_Stub.java:510)



could there be some System property needed by sun's RMI that tomcat is overwriting?
Comment 4 Remy Maucherat 2001-11-12 13:37:52 UTC
I've cleaned the file URLs generated by the classloader (in the HEAD branch 
only at this time). Now, all of them should be canonical. If this does not fix 
the problem, there's nothing else that Tomcat can do, and it looks more like a 
JDK problem.
Comment 5 C K Baughman 2002-03-14 18:34:16 UTC
This appears to be a JDK problem.  In the Javasoft dug database it's #4496398
and #4273532.  Despite what's said in those bugs however, using JDK1.4 does not
appear to solve the problem.
Comment 6 Hyung Lee 2003-11-06 21:01:43 UTC
Even thought, it is a problem with URL class, you can get around by using getURI
() of File class.

For example,
jakarta-tomcat-4.0
\catalina\src\share\org\apache\catalina\startup\ClassLoaderFactory.java has 
following line:
URL url = new URL("file", null, file.getCanonicalPath());

I solved the malFormedURL issue by changing as following:
URL url = file.toURI().toURL();

Hope this helps.
Comment 7 Jamie Bisotti 2004-09-03 13:07:33 UTC
Why is the resolution WONTFIX?  Especially when there is an apparent fix in the
comments below?

Jamie
Comment 8 Jamie Bisotti 2004-09-03 13:08:13 UTC
Why is the resolution WONTFIX?  Especially when there is an apparent fix in the
comments below?

Jamie
Comment 9 Shawn Bertini 2004-11-11 18:04:36 UTC
Created attachment 13405 [details]
clean work-around with need for security policy input