Problems with RMI

Archie Cobbs archie at whistle.com
Fri Jul 14 10:37:56 PDT 2000


Lindeijer, D.G. writes:
> 2: kaffes RMI classloaded constructs incorrect URLs, if it needs to download
> a class A in package x.y.z it requests http: //host/../x.y.z.A.class instead
> of  http: //host/../x/y/z/A.class  

This is a wild guess (I know little about RMI) but here's a possible fix:

Index: RMIClassLoader.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/extensions/rmi/javalib/java/rmi/server/RMIClassLoader.java,v
retrieving revision 1.2
diff -u -r1.2 RMIClassLoader.java
--- RMIClassLoader.java	1999/10/10 00:32:45	1.2
+++ RMIClassLoader.java	2000/07/14 17:37:24
@@ -33,7 +33,7 @@
 }
 
 public static Class loadClass(URL codebase, String name) throws MalformedURLException, ClassNotFoundException {
-	URL u = new URL(codebase, name + ".class");
+	URL u = new URL(codebase, name.replace('.', '/') + ".class");
 	try {
 		URLConnection conn = u.openConnection();
 		DataInputStream strm = new DataInputStream(conn.getInputStream());

You'd need to rebuild rmi.jar too of course.

-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com


More information about the kaffe mailing list