Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.rmi.UnmarshalException: (RMIunder Linux)

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai,
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
 
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
Chris
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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*
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
fe@inf.ufsc.br
 
Fernanda Silveira
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SOLVED:
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
fe@inf.ufsc.br
 
Chris Shepherd
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
Chris
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
>>/user/bin/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
http://www.wssolucoes.com.br
Brazil.
 
Did you miss me? Did you miss this tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic