[RMI] SocketTimeoutException: Read timed out

Discussion in 'Java' started by Andre Raue, Apr 5, 2004.

  1. Andre Raue

    Andre Raue Guest

    Hello,

    I just started to build a small RMI example for testing purpose.
    everything works fine on Windoze. But when I try to start the Server
    on Linux I get the exception shown below. I'm using Java SDK 1.4.2_04
    on both machines. You'll find my server class and policy file below.

    I would be glad about some help...

    Greetings

    Andre


    Exception:
    -----------------------------------
    ~/java/test > java -jar ByteGetterServer.jar
    ByteGetterServer exception: error during JRMP connection establishment;
    nested exception is:
    java.net.SocketTimeoutException: Read timed out
    java.rmi.ConnectIOException: error during JRMP connection establishment;
    nested exception is:
    java.net.SocketTimeoutException: Read timed out
    at
    sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:274)
    at
    sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)
    at
    test.java.basics.rmi.server.ByteGetterServer.main(ByteGetterServer.java:47)
    Caused by: java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
    at java.io.DataInputStream.readByte(DataInputStream.java:331)
    at
    sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:215)
    ... 5 more
    -------------------------------


    Server class:
    -------------------------------
    package test.java.basics.rmi.server;

    import java.rmi.Naming;
    import java.rmi.RMISecurityManager;
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;

    import test.java.basics.rmi.ByteGetter;

    public class ByteGetterServer
    extends UnicastRemoteObject
    implements ByteGetter {

    protected ByteGetterServer() throws RemoteException {
    super();
    }

    public byte[] getBytes() throws RemoteException {
    byte[] someBytes = "Hallo".getBytes();
    return someBytes;
    }

    public static void main(String[] args) {
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
    }
    try {
    ByteGetter aByteGetter = new ByteGetterServer();
    Naming.rebind("rmi://localhost/ByteGetter", aByteGetter);
    System.out.println("ByteGetter-Server gestartet!");
    } catch (Exception e) {
    System.err.println("ByteGetterServer exception: " + e.getMessage());
    e.printStackTrace();
    }
    }
    }
    ------------------------------


    Policy file:
    ------------------------------
    grant {
    permission java.net.SocketPermission "*:1024-65535", "connect, accept";
    };
    ------------------------------
     
    Andre Raue, Apr 5, 2004
    #1
    1. Advertising

  2. Andre Raue

    Andre Raue Guest

    [RMI] How to watch port 1099 (was: [RMI] SocketTimeoutException:Read timed out)

    Hello,

    as I am still having trouble to get my RMI-Server started on Linux, I
    would like to see, what is happening on port 1099 on Linux and on Win NT.

    Does anybody know how to do this. Which software do I need? Any proposals?

    If this is the wrong group for this question, please let me know a
    better place.

    Greetings

    Andre



    Andre Raue wrote:
    > Hello,
    >
    > I just started to build a small RMI example for testing purpose.
    > everything works fine on Windoze. But when I try to start the Server on
    > Linux I get the exception shown below.
    > [snip]
    >
    > Exception:
    > -----------------------------------
    > ~/java/test > java -jar ByteGetterServer.jar
    > ByteGetterServer exception: error during JRMP connection establishment;
    > nested exception is:
    > java.net.SocketTimeoutException: Read timed out
    > java.rmi.ConnectIOException: error during JRMP connection establishment;
    > nested exception is:
    > java.net.SocketTimeoutException: Read timed out
    > at
    > sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:274)
    > at
    > sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
    > at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
    > at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    > at java.rmi.Naming.rebind(Naming.java:160)
    > at
    > test.java.basics.rmi.server.ByteGetterServer.main(ByteGetterServer.java:47)
    > Caused by: java.net.SocketTimeoutException: Read timed out
    > at java.net.SocketInputStream.socketRead0(Native Method)
    > at java.net.SocketInputStream.read(SocketInputStream.java:129)
    > at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    > at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
    > at java.io.DataInputStream.readByte(DataInputStream.java:331)
    > at
    > sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:215)
    > ... 5 more
    > -------------------------------
     
    Andre Raue, Apr 12, 2004
    #2
    1. Advertising

  3. Andre Raue

    Nigel Wade Guest

    Re: [RMI] How to watch port 1099

    Andre Raue wrote:
    > Hello,
    >
    > as I am still having trouble to get my RMI-Server started on Linux, I
    > would like to see, what is happening on port 1099 on Linux and on Win NT.
    >
    > Does anybody know how to do this. Which software do I need? Any proposals?
    >


    Ethereal is the best tool, a GUI driven packet dump/analyser.
    Tcpdump is a similar command line tool.


    --
    Nigel Wade, System Administrator, Space Plasma Physics Group,
    University of Leicester, Leicester, LE1 7RH, UK
    E-mail :
    Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
     
    Nigel Wade, Apr 14, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve
    Replies:
    0
    Views:
    5,394
    Steve
    Jul 1, 2003
  2. sven abels

    Strange SocketTimeoutException

    sven abels, Dec 1, 2003, in forum: Java
    Replies:
    0
    Views:
    477
    sven abels
    Dec 1, 2003
  3. Replies:
    5
    Views:
    6,363
    jan V
    Sep 3, 2005
  4. Replies:
    4
    Views:
    22,562
    anupam
    Nov 1, 2012
  5. laredotornado
    Replies:
    2
    Views:
    4,632
Loading...

Share This Page