我正在尝试使用Eclipse作为IDE在我的机器上调试一个简单的Java应用程序。当我试图通过进入debug透视图来调试应用程序时,我设置了一个断点并开始调试。几秒钟后,将弹出以下窗口:
Launching unicodeRead has encountered a problem. Cannot connect to VM
。
控制台转储的消息如下:
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:708]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
我该如何纠正这个问题呢?这一切为什么要发生?
发布于 2012-02-27 23:17:39
我也有同样的问题。
昨天一切正常,现在什么都没有了--和你给出的错误一样。我发现网络管理员在此期间做了一些改变。一些防火墙的东西。问题是Eclipse试图在"localhost“(和一些随机端口)建立到JVM的连接。当我尝试pinging localhost (或127.0.0.1)时,得到的结果如下:
C:\Windows\system32>ping 127.0.0.1
Pinging 127.0.0.1 with 32 bytes of data:
PING: transmit failed. General failure.
PING: transmit failed. General failure.
PING: transmit failed. General failure.
PING: transmit failed. General failure.
和
C:\Windows\system32>ping localhost
Ping request could not find host localhost. Please check the name and try again.
它认为,在某些情况下,DNS有望解决这个问题,如果防火墙阻止本地主机请求DNS - stuff中断。我必须更改主机文件并删除以下行中的注释,因此我将不再依赖DNS:
# 127.0.0.1 localhost
# ::1 localhost
虽然写的是主机文件更改立即生效,但我认为在我的情况下,某些进程锁定了它并重新启动是必要的。在那之后,一切都恢复了正常。
发布于 2018-05-15 15:26:02
我在使用-X格式时发现了一个错误:
java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n myapp
当我切换到新的格式时,这个错误就消失了:
java -agentlib:jdwp=transport=dt_socket,server=y,address=4000,suspend=n myapp
发布于 2011-09-20 23:17:19
看起来和here有同样的问题。重新启动pc解决了那里的问题。我还没有找到任何其他的解决方案。
https://stackoverflow.com/questions/7487526
复制相似问题