Could not connect to:  : 50404			
java.net.ConnectException: Connection refused: connect
	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: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 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.connect(RemoteTestRunner.java:560)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:377)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

has anyone run into this issue and or find a fix? I've not been able to get much from google. I have been running unit tests no problem them wham it poops out :P.

I've tried restarting, disconnecting the network cable, starting up a new instance of eclipse, disabling the windows firewall...etc

However if I run a "mvn test" on the project from the command line all goes well as expected >_<

Ending up being able to solve this one. Debugged the servlet used for the connection to the JUnit window. Found it was using the wrong port (for some reason it was placing it a single digit below the correct port) and stepped through each iteration of the servlet doConnect() method adjusting the port each time.

Once I did that JUnit testing began to work as normal; hopefully however, it will continue to do so next time I start up eclipse :P

Hey,

I've seen this problem, too, on a corporate laptop when it wasn't connected to the corporate network (by being either plugged directly into it or tunneled in with the laptop's Nortel VPN client). Stopping the laptop's "McAfee Host Intrusion Prevention Service" would resolve the problem and enable Eclipse to run JUnit tests.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.