FitNesse cannot retrieve socket

I sometime experience the problem that FitNesse cannot execute tests anymore. After pressing the “Test” button test execution starts, hangs, and after a timeout I get the following error in the log:

Internal Exception:

 java.lang.Exception: FitClient: communication socket was not received on time.
    fitnesse.components.CommandRunningFitClient$TimeoutRunnable.run(CommandRunningFitClient.java:126)
    java.lang.Thread.run(Thread.java:613)

The executed command is:
java -cp /Users/thoms/.m2/repository/org/fitnesse/fitnesse/20090214/fitnesse-20090214.jar:……. :classes:fitnesse.jar:fitlibrary.jar fit.FitServer thoms.local 8080 1

After reading a but through the source I came to the point that this problem arises, when the class FitServer wants to establish a socket for host ‘thoms.local’ and port 8080. Now ‘thoms.local’ is of course my local host, and therefore the same as localhost and 127.0.0.1. I tested now with a small class:

This here works:

public class SocketTest {
    public static void main(String[] args) throws Exception  {
        Socket socket = new Socket(“localhost”, 8080);
        System.out.println(“Socket established”);
        socket.close();
    }
}


When replacing ‘localhost’ by ‘thoms.local’ I get the same problem.

        Socket socket = new Socket(“localhost”, 8080);

Exception in thread “main” java.net.ConnectException: Operation timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:430)
    at java.net.Socket.connect(Socket.java:520)
    at java.net.Socket.connect(Socket.java:470)
    at java.net.Socket.<init>(Socket.java:367)
    at java.net.Socket.<init>(Socket.java:180)
    at playground.SocketTest.main(SocketTest.java:12)

For now I cannot explain why this is happening. Also FitNesse should not call FitServer with ‘thoms.local’, since I call FitNesse with http://localhost:8080.

Blogged with the Flock Browser

Tags: ,

Advertisements

One thought on “FitNesse cannot retrieve socket

  1. Pingback: Socket problem observations « Karsten’s Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s