Eclipse JDWP error when trying to debug

8.8k views Asked by At

I get the following error when trying to debug a local java application in eclipse.

FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]

I read that it might be caused by something using the same port as the one eclipse wants to use for debugging, but how do I determine the port number. I couldn't find anything in the error log or the preferences.

Any ideas?

3

There are 3 answers

1
cleberz On

I ran into the same issue and it turns out I was specifying server=n parameter in the jdwp debug string. It turns out that if we specify server=n in the debug connection string, it'll attempt to attach/connect to that port instead of listening on it. Switching to server=y solved my issue. It's documented in the official jpda documentation.

0
Sharan kumar On

Please ensure that, the below entry is there in /etc/hosts file (for mac/linux)

127.0.0.1      localhost 

Previously I unknowingly commented out this line, so it worked for me after reverting back. Hope this helps.

1
andrex On

Maybe it's your antivirus. Are you using avast if so look at this https://feedback.avast.com/responses/eclipse-debug-functionality-not-working-after-upgrade-to-avast-2014

The solution is upgrading to the latest version of avast (http://forum.avast.com/index.php?topic=139606.0)