Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

java.rmi.MarshalException: Error marshaling arguments; nested exception

4 views
Skip to first unread message

mandiie

unread,
Oct 22, 2001, 4:51:01 AM10/22/01
to
I have a Java app which uses RMI calls on bound interfaces to create
remoteable objects. This works fine. I call my create object method on
an interface in the RMIRegistry created with Naming.Rebind, and the
created object is also derived from UnicastRemoteObject so it's
interface can be used directly by the client. My problem is when i
used localhost it's complete but when i used other client it has the
following exeption while connecting to a remote for sending data to :

java.rmi.MarshalException: Error marshaling arguments; nested
exception is:
java.net.SocketException: Connection aborted by peer: socket
write error

java.net.SocketException: Connection aborted by peer: socket write
error
at java.net.SocketOutputStream.socketWrite(Native Method)
at java.net.SocketOutputStream.write(SocketOutputStream.java:83)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:112)
at java.io.ObjectOutputStream.drain(ObjectOutputStream.java:1463)
at java.io.ObjectOutputStream.setBlockData(ObjectOutputStream.java:1486)

at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:407)
How can i do please get me an answer.
Best Regards,
Changolden

Phil Earnhardt

unread,
Oct 22, 2001, 10:50:54 AM10/22/01
to
On 22 Oct 2001 01:51:01 -0700, chang...@poppymail.com (mandiie)
wrote:

>I have a Java app which uses RMI calls on bound interfaces to create
>remoteable objects. This works fine. I call my create object method on
>an interface in the RMIRegistry created with Naming.Rebind, and the
>created object is also derived from UnicastRemoteObject so it's
>interface can be used directly by the client. My problem is when i
>used localhost it's complete but when i used other client it has the
>following exeption while connecting to a remote for sending data to :
>
>java.rmi.MarshalException: Error marshaling arguments; nested
>exception is:

You have a classloader problem. You're not providing the RMIregistry
with sufficient information to instruct the client where to load the
.class file for the stub for your remote object. It's probably working
in the local case because you have the client and the server files in
the same directory and the client is finding the needed stub in its
class path.

You can simulate the problem on a single machine, but you need to be
careful to completely segregate your server code from your client
code. Your client hierarchy should NOT include the stubs. You should
also start the RMIregistry in a different directory than the client or
the server.

>How can i do please get me an answer.

There's a tutorial at
http://developer.java.sun.com/developer/onlineTraining/rmi/ that
covers some of the information about deploying an RMI application.

O'Reilley is publishing _Java RMI_ this month. I'm sure they will deal
extensively with deployment in that book. I'm sure other books talk
about this. I just don't have any recommendations.

>Best Regards,
>Changolden

--phil

Phil Earnhardt

unread,
Nov 4, 2001, 1:38:06 AM11/4/01
to
On Mon, 22 Oct 2001 08:50:54 -0600, Phil Earnhardt <p...@dim.com>
wrote:

>O'Reilley is publishing _Java RMI_ this month. I'm sure they will deal
>extensively with deployment in that book. I'm sure other books talk
>about this. I just don't have any recommendations.

This book is now published. I read the chapter on dynamic classloading
tonight; it is very good. Before explaining the mechanisms, the author
explains the motivation for dynamic classloading. And he gets to all
of the little details -- like why you don't want any application code
in the CLASSPATH of the rmiregistry.

I recommend this book to anyone doing production programming -- and
deployment -- of Java code using RMI.

--phil

0 new messages