ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guy Argo <guy_a...@YAHOO.COM>
Subject Problems trying to write a RMI <-> XMLRPC bridge
Date Thu, 03 Aug 2006 00:35:30 GMT
I'm trying to write a RMI <-> XMLRPC bridge.
I want two bits of functionality:
a RMI server that receives RMI requests
and transforms then into XMLRPC calls;
a XMLRPC server that a receives XMLRPC calls
and turns them into RMI requests.

I have a non-Java piece of monitoring code that
can speak XMLRPC that I want to put between my
RMI client and server like so:

RMI client <-> RMI server/XMLRPC client <-> black box <-> XMLRPC  
server/RMI client <-> RMI Server.

My idea was to use the Proxy class.
I tested this out by writing a simple RMILogger
that you put between your client and server and
it simply writes the parameters and result to System.err:

LoggingProxy http://pastie.caboo.se/7051
Rmi          http://pastie.caboo.se/7080
RMILogger    http://pastie.caboo.se/7081

Worked fine.
Then I built a Calculator example in RMI:

Calculator            http://pastie.caboo.se/7054
CalculatorImpl        http://pastie.caboo.se/7055
CalculatorInterpreter http://pastie.caboo.se/7056
CalculatorRMIServer   http://pastie.caboo.se/7057
CalculatorRMIClient   http://pastie.caboo.se/7082

Worked fine.
Then I built a Calculator example in XMLRPC:

XmlRpc                 http://pastie.caboo.se/7083
CalculatorXMLRPCServer http://pastie.caboo.se/7084
CalculatorXMLRPCClient http://pastie.caboo.se/7086

Worked fine.

Then I tried to write RmiToRpcAdaptor:

RmiToRpcAdapter        http://pastie.caboo.se/7090

I get:

% java RmiToRpcAdapter Evaluator 127.0.0.1 8000 Calculator
Exception in thread "main" java.rmi.MarshalException: error  
marshalling arguments; nested exception is:
         java.io.NotSerializableException:  
org.apache.xmlrpc.client.util.ClientFactory$1
         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:27)
Caused by: java.io.NotSerializableException:  
org.apache.xmlrpc.client.util.ClientFactory$1
         at java.io.ObjectOutputStream.writeObject0 
(ObjectOutputStream.java:1075)
         at java.io.ObjectOutputStream.defaultWriteFields 
(ObjectOutputStream.java:1369)
         at java.io.ObjectOutputStream.writeSerialData 
(ObjectOutputStream.java:1341)
         at java.io.ObjectOutputStream.writeOrdinaryObject 
(ObjectOutputStream.java:1284)
         at java.io.ObjectOutputStream.writeObject0 
(ObjectOutputStream.java:1073)
         at java.io.ObjectOutputStream.defaultWriteFields 
(ObjectOutputStream.java:1369)
         at java.io.ObjectOutputStream.writeSerialData 
(ObjectOutputStream.java:1341)
         at java.io.ObjectOutputStream.writeOrdinaryObject 
(ObjectOutputStream.java:1284)
         at java.io.ObjectOutputStream.writeObject0 
(ObjectOutputStream.java:1073)
         at java.io.ObjectOutputStream.defaultWriteFields 
(ObjectOutputStream.java:1369)
         at java.io.ObjectOutputStream.writeSerialData 
(ObjectOutputStream.java:1341)
         at java.io.ObjectOutputStream.writeOrdinaryObject 
(ObjectOutputStream.java:1284)
         at java.io.ObjectOutputStream.writeObject0 
(ObjectOutputStream.java:1073)
         at java.io.ObjectOutputStream.writeObject 
(ObjectOutputStream.java:291)
         ... 4 more

It apparently wants to serialize ClientFactory$1.
But I don't have control over  
org.apache.xmlrpc.client.util.ClientFactory.
Am I SOL?
Suggestions welcome.
Guy


---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-user-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-user-help@ws.apache.org


Mime
View raw message