[jdom-interest] Document and RMI

David M. Lang david at adlibsys.co.uk
Thu Sep 7 23:32:30 PDT 2000


A quick question. I'd like to use XML to provide an extensible method
argument list, in a manner analagous to XML-RPC, but less formalised. The
intention is to represent the XML argument list as a JDOM document, and pass
this to a remote Java object, as follows:

public interface Service extends java.rmi.Remote
  public Document request(Document doc) throws RemoteException;

The problem is that I get a run-time java.rmi.MarshalException, complaining
that Namespace isn't serializable. Making Namespace subscribe to the
java.io.Serializable marker interface fixes the problem.

However, I'm surely missing something. Is this an efficient way to do this?
Should I convert the Document to a String argument and pass that? Or should
I subclass Document, and make it a remote object?

Any help greatly appreciated. Thanks in advance.
(I'm using JDOM Beta 4)

David Lang

More information about the jdom-interest mailing list