Skip to Main Content

Java APIs


For appeals, questions and feedback about Oracle Forums, please email Please ask technical questions in the appropriate category. Thank you!

SocketException: Connection reset by peer: socket write error RMI Server Class

e54b6fe1-20e3-4917-ac8f-b8b82798ca3cNov 5 2014 — edited Feb 11 2015

I am new to distributed application development. Got a project from university of making a chess game which can be played over the LAN. I started learning RMI to complete his project. I am using Eclipse and RMI plugin from genday. When I try to load the server class after starting registry. It doesn't throw any error exception in the server class console but server class stops before completion.

import java.rmi.RemoteException;

import java.rmi.registry.LocateRegistry;

import java.rmi.registry.Registry;

public class Server {

    public static void main(String args[]){


            PrintString stub = new PrintStringImpl();

            Registry registry = LocateRegistry.getRegistry();


            registry.rebind("PrintString", stub);


        }catch(RemoteException ex){





This Sever class print registry details before registry.rebind() and crashed at the same point without printing "Started". I displayed another console which is "C:\Program Files\Java\jdk\bin\rmiregistry.exe (localhost: 1099)". it is showing error like

Exception dispatching call to [0:0:0, 0] in thread "RMI TCP Connection(2)-" at Wed Nov 05 09:52:03 PKT 2014:

java.rmi.UnmarshalException: error unmarshalling call header; nested exception is: Connection reset by peer: socket write error

    at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)

    at sun.rmi.transport.Transport$ Source)

    at sun.rmi.transport.Transport$ Source)

    at Method)

    at sun.rmi.transport.Transport.serviceCall(Unknown Source)

    at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)

    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)

    at sun.rmi.transport.tcp.TCPTransport$ Source)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

    at java.util.concurrent.ThreadPoolExecutor$ Source)

    at Source)

Caused Connection reset by peer: socket write error

    at Method)

    at Source)

    at Source)

    at Source)

    at Source)

    at$BlockDataOutputStream.flush(Unknown Source)

    at Source)

    at sun.rmi.transport.StreamRemoteCall.releaseOutputStream(Unknown Source)

    at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)

    ... 11 more

As far as, I am tackling with this problem by restarting laptop, and after restart it again works fine. There is no firewall installed and working on my computer. Any help would be greatly appreciated.

Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 11 2015
Added on Nov 5 2014