Eclipse JDWP error when trying to debug

醉酒当歌 提交于 2019-12-10 17:46:19

问题


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?


回答1:


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.




回答2:


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)



来源:https://stackoverflow.com/questions/18612986/eclipse-jdwp-error-when-trying-to-debug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!