Message76
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);
}
}
}
|
|
Date |
User |
Action |
Args |
2008-02-20 17:16:40 | admin | link | issue222818 messages |
2008-02-20 17:16:40 | admin | create | |
|