Issue222818

classification
Title: JPython-1.1beta3 fails with Jini 1.0 on JDK 1.2
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: pedronis Nosy List: bckfnn, pedronis
Priority: low Keywords:

Created on 2000-11-18.19:16:14 by bckfnn, last changed 2000-12-16.20:50:23 by pedronis.

Messages
msg76 (view) Author: Finn Bock (bckfnn) Date: 2000-11-18.19:16:14
Synopsis: When trying to run the jini.py code shown below, JPython issues a
ClassNotFoundError for the RegistrarImpl_Stub class which is the rmi stub for
the remote Registrar object being obtained.

Supporting Information:
1. JPython-1.1beta2 also fails
2. JPython103 (with add_package code) works
3. Both 1.1 beta versions work with JDK 1.2.2
4. Parallel algoritm written in pure java works with JDK 1.2.

Test Case:
System:
1. Win NT 4.0
2. Jini 1.0
3. JDK 1.2
4. JPython-1.1beta3

Setup:
1. Start Sun's HTTP Server from Jini package (tools.jar)
2. Start Sun's RMI activation daemon (rmid.exe)
3. Start Sun's Lookup server (reggie.jar)
4. Change YOURHOST to the host address in jini.py

Test:
Execute jpython jini.py

Expected Result:
Output: "Got lookup locator YOURHOST"
Error Message regarding ClassNotFound RegistrarImpl_Stub

Execute java jini

Expected Result:
Output: "Got lookup locator"
Output: "Got Registrar"

jini.py:
"""
# The following add_package code is needed for JPython103 or earlier
import sys
sys.add_package('net.jini.core.lookup')
sys.add_package('net.jini.core.discovery')
"""

from net.jini.core.discovery import LookupLocator

lookup = LookupLocator("jini://YOURHOST/")
print "Got lookup locator", lookup

registrar = lookup.getRegistrar()
print "Got registrar:", registrar


jini.java:

import net.jini.core.discovery.LookupLocator;
import net.jini.core.lookup.ServiceRegistrar;
import java.io.IOException;
import java.net.MalformedURLException;
import java.rmi.RemoteException;

public class jini
{

    public static void main(String args[]) {
	LookupLocator loc;
	ServiceRegistrar reg;

	String url = "jini://YOURHOST/";

	try {

	    loc = new LookupLocator(url);
            System.out.println("Got lookup locator");
	    reg = loc.getRegistrar();
            System.out.println("Got registrar");

	} catch (MalformedURLException ex) {
	    System.err.println("Malformed URL Exception: " + ex.getMessage());
	    System.exit(1);
	} catch (RemoteException ex) {
	    System.err.println("RemoteException: " + ex.getMessage());
	    System.exit(1);
	} catch (IOException ex) {
	    System.err.println("IOException: " + ex.getMessage());
	    System.exit(1);
	} catch (ClassNotFoundException ex) {
	    System.err.println("ClassNotFoundException: " + ex.getMessage());
	    System.exit(1);
	}
    }
}

msg77 (view) Author: Samuele Pedroni (pedronis) Date: 2000-12-16.20:50:23
As of jini 1.1, jdk 1.3 and jython 2.0a1+
this works.
This could have been a configuration problem.
Or a problem related to the old buggy
runtime not using classes directly but 
classes -> names back to classes (so possibly from
the wrong ctxt/loader) in many places.
History
Date User Action Args
2000-11-18 19:16:14bckfnncreate