Ended up using the working Java client up as a delegate to the RawDBServer stub and creating it directly in Jython. Worked just fine.
TWAndrews
@TWAndrews
Best posts made by TWAndrews
Latest posts made by TWAndrews
-
RE: Connect to Java RMI Server from Jython
-
Connect to Java RMI Server from Jython
I have a Java (version 1.5) RMI server which I need to connect to via Jython. This seems like it should be easy, however, I keep getting an exception of the following variety:
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: RawDBServer
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
Where RawDBServer is an interface which extends java.rmi.Remote and has an implementation which extends java.rmi.UnicastRemoteObject which is bound to the RMI registry appropriately. Interestingly, if I create a small client in Java, I'm able to connect with the following code:String objName = "rmi://" + hostname + ":" + port + "/" + RawDBServer.SERVER_NAME;
RawDBServer server = (RawDBServer) Naming.lookup(objName);
if (server != null) {
System.out.println("Connected")
}However, if I use the following code in my jython client (with the same values for the hostname and port), I get the aforementioned exception:
objName = "rmi://" + rawDBHostname + ":" + rawDBPort + "/" + RawDBServer.SERVER_NAME
DB_SERVICE = Naming.lookup(objName);Does anyone have any experience, or any resources about connecting to a Java RMI server from jython? Any help would be appreciated. I know in previous versions of Java you needed to do a special compilation for remote classes, but I thought that had gone away in Java 1.5