Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JUnit could not connect

563391Jun 30 2010 — edited Jun 30 2010
Hi,

I'm trying to run a JUnit test, but I get the following exception:
Could not connect to:  : 53612			
java.net.ConnectException: Connection 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:366)
	at java.net.Socket.connect(Socket.java:529)
	at java.net.Socket.connect(Socket.java:478)
	at java.net.Socket.<init>(Socket.java:375)
	at java.net.Socket.<init>(Socket.java:189)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.connect(RemoteTestRunner.java:570)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:381)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
The socket number varies with every execution.
I'vre read in some post that could be fixed by restarting eclipse. Done that, but didn't help.
I've also set the -vm parameter on ecplise.ini to the java installation the JUnit claims to be using. Restarted the IDE and got the same error.
I've read this might have something to do with LAN configuration, I don't see how but I'm out of ideas, so here is the /etc/network/interfaces file
auto eth0
iface eth0 inet static
address 172.16.10.84
netmask 255.255.240.0
gateway 172.16.1.2

Any help is mostly welcome.
Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2010
Added on Jun 30 2010
1 comment
302 views