Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse JDWP error when trying to debug

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?

like image 959
Peter Avatar asked Dec 26 '22 21:12

Peter


2 Answers

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.

like image 138
cleberz Avatar answered Jan 09 '23 01:01

cleberz


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)

like image 34
andrex Avatar answered Jan 09 '23 03:01

andrex