I have a java rmi client-server and I need to put a VB program in the middle to perform some monitoring. To facilitate this, I wrote a rmi-xmlrpc bridge in Java. It acts as a RMI server and converts the RMI method calls into XMLRPC method calls. Unfortunately running it fails because it's apparently trying to serialize the whole xmlrpc infrastructure. I need to get this working ASAP.
More details at: http://pastie.caboo.se/7745
fundedPeople succeed in answering guy_argo's questions 0% of the time (0 success in 3 attempts).
Answers by: Dane Summers | Don Miguel de los Platanos | Jason McMunn
It's been a while since I've done any RMI, however the first thing that comes to mind is that you shouldn't need to send the xmlrpcClient over the wire to the RMI client. I've tried changing RpcProxy's variable xmlrpcClient to 'transient' so it doesn't get serialized. This does get rid of the exception you have. But then I get another one...
The most important snippet:
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at Rmi.createServer(Rmi.java:28)
at RmiToRpcAdapter.main(RmiToRpcAdapter.java:22)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: Calculator
At any rate - if I make any further progress on this I'll let you know. If I don't, perhaps this will lead you toward a solution.
I tried your suggestion and I did get further but I think the progress is illusionary - I now get a NullPointer exception from the CalculatorRMIClient when it's tries to access the RmiToRpcAdapter remotely.
% java CalculatorRMIClient 127.0.0.1 calculator
1+1
Error evaluating "1+1"
java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at RmiToRpcAdapter.invoke(RmiToRpcAdapter.java:33)
at $Proxy0.add(Unknown Source)
at CalculatorInterpreter.eval(CalculatorInterpreter.java:62)
at CalculatorInterpreter.interact(CalculatorInterpreter.java:83)
at CalculatorRMIClient.main(CalculatorRMIClient.java:13)
(BTW, to avoid the error you were getting, you need to pass a value for java.rmi.server.codebase like so: java -Djava.rmi.server.codebase='file:///Users/guyargo/Projects/consulting/verismart/simple2/classes/' RmiToRpcAdapter calculator 127.0.0.1 8000 Calculator).