4

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?

Peter
  • 1,047
  • 2
  • 18
  • 32
  • Have you cleared up any potential firewall issues? Looks similar to http://stackoverflow.com/questions/1057376/eclipse-3-x-unable-to-debug-tomcat-5-5-with-java-1-6-0-14 . – nitind Sep 04 '13 at 16:35

3 Answers3

9

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.

cleberz
  • 601
  • 7
  • 11
1

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)

Pablo
  • 3,655
  • 2
  • 30
  • 44
andrex
  • 983
  • 5
  • 14
  • @gnat sorry about that I just found the answer from that link and just wanted to share it since it's not my own solution i just posted the link. So here is the explaination, some anti virus esp. avast will block some firewalls and a recent update of it seems to have a bug, then they released a fixed in the latest version. So you need first to make a clean uninstall and re-install the latest version. I don't know about the other antivirus software but I used avast and it fixed the issue for me. – andrex Nov 23 '13 at 01:45
0

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.