jQuery in Action, 3rd edition
The moose likes Distributed Java and the fly likes java.rmi.UnmarshalException: (RMIunder Linux) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "java.rmi.UnmarshalException: (RMIunder Linux)" Watch "java.rmi.UnmarshalException: (RMIunder Linux)" New topic

java.rmi.UnmarshalException: (RMIunder Linux)

Rajesh chintech

Joined: Feb 16, 2004
Posts: 9
I am facing a problem in rmi , when running my RMI server program, I am a beginner to this area, earlier it was working and i got the output, i didnt change anything, i used three windows to test my program, one for rmiregistry, another for running the server and other for running the client.
But when i execute server, after two seconds i got the following error,
Trouble java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.net.SocketException: Connection reset
please help me to solve this.
rajesh kumar
Chris Shepherd
Ranch Hand

Joined: Jun 27, 2000
Posts: 286
You said you didn't change anything from before. So was the only difference that you used 3 different windows to start the programs? Hwo did you do it before when it did work? What order didi you start them in?
A Johansson

Joined: Mar 23, 2004
Posts: 1
I got exactly the same thing trying to start a simple server on the same machine as the rmiregistry is running:
Error unmarshaling return header; nested exception is: java.net.SocketException: Connection reset
The thing is, there is only one computer that is able to start the server properly, all others give this exception.
Why is this happening and what do I do about it? *hopeless*
Fernanda Silveira

Joined: Jul 24, 2003
Posts: 17
I'm facing the same problem. When I run the server on other machines everything is ok. When I run the server on my machine (Linux Red Hat 9 - jdk 1.4.2) I got this exception:
/usr/java/j2sdk1.4.2_04/bin/java -Djava.security.policy=java.policy Cadastrador
antes de rebind
Cadastrador Exception: Error unmarshaling return header; nested exception is:
java.net.SocketException: Connection reset
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.net.SocketException: Connection reset
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:203)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at Cadastrador.main(Cadastrador.java:27)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:222)
at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2150)
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2163)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2631)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:734)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:253)
at sun.rmi.server.MarshalInputStream.<init>(MarshalInputStream.java:110)
at sun.rmi.transport.ConnectionInputStream.<init>(ConnectionInputStream.java:38)
at sun.rmi.transport.StreamRemoteCall.getInputStream(StreamRemoteCall.java:111)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:197)
... 4 more
Did you find the reason for this to happen?
Fernanda Silveira

Fernanda Silveira
Fernanda Silveira

Joined: Jul 24, 2003
Posts: 17
I read in another discussion list about changing the jdk.
I was using the j2sdk1.4.2 from SUN and now I got it from Blackdown (www.blackdown.org) and my server is working !!
Fernanda Silveira
Chris Shepherd
Ranch Hand

Joined: Jun 27, 2000
Posts: 286
Well Im glad that you got things working, but that doesn't explain why it wasn't working before.
I wish we had some better idea why its not working for somepeople. Are you trying to run everything on a single machine(RH9)? And it doesn't work but when running everything on a different machine it does or are you saying that when you run the server on a different machine and the client from yours, that it works?
William Sbordoni

Joined: Jun 27, 2003
Posts: 3
To resolve this problem you can use the command on Linux:
[user@server]$ which rmiregistry
Probably will show the rmi from Linux
>>[user@server]$ which rmiregistry
You can just remove or change the name, see bellow.
>>[user@server]$cd /usr/bin
>>[user@server]$mv rmiregistry _rmiregistry
>>[user@server]$mv rmic _rmic
if you type the command again see the result.
>>[user@server]$ which rmiregistry
>>/user/local/j2sdk1.4.0/bin/rmiregistry //This is the correct rmiregistry to use.
For me it's work fine.
William A. Sbordoni
I agree. Here's the link: http://aspose.com/file-tools
subject: java.rmi.UnmarshalException: (RMIunder Linux)
It's not a secret anymore!