尝试调试时出现Eclipse JDWP错误 [英] Eclipse JDWP error when trying to debug
问题描述
尝试在eclipse中调试本地Java应用程序时出现以下错误.
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]
我读到它可能是由于某些东西使用了与一个eclipse想要用于调试的端口相同的端口引起的,但是我如何确定端口号.我在错误日志或首选项中找不到任何内容.
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.
有什么想法吗?
推荐答案
我遇到了同样的问题,结果发现我在jdwp调试字符串中指定了server = n参数.事实证明,如果我们在调试连接字符串中指定server = n,它将尝试连接/连接到该端口,而不是侦听该端口.切换到 server = y 解决了我的问题.它记录在 官方jpda文档.
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.
这篇关于尝试调试时出现Eclipse JDWP错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!