无法通过 SSH 隧道远程调试 JVM
我需要通过 SSH 隧道使用远程调试器来调试 Java 应用程序。我在我的 PC 上配置了 putty,并且可以使用隧道连接到服务器上运行的任何其他服务,但是 eclipse 远程调试器无法连接。
在服务器端,我使用 Java 1.6.0_21-b06,并以以下调试选项开始:
-Xrunjdwp:transport=dt_socket,address=8686,server=y,suspend=n
在我的笔记本电脑上配置了 ssh 隧道如:
L8686 IP_ADDR:8686
通过 ssh 隧道运行会话时,JVM 调试器是否有任何限制?
另一件事是,当我尝试连接时,在服务器控制台上我可以看到以下日志消息:
正在监听地址为 8686 的传输 dt_socket
I need to debug a Java application using remote debugger via an SSH tunnel. I configured putty on my PC and I'm able to connect to any other service running on the server using tunnel however eclipse remote debugger fails to connect.
On the server side I use Java 1.6.0_21-b06 started with following debug options:
-Xrunjdwp:transport=dt_socket,address=8686,server=y,suspend=n
On my laptop ssh tunnel is configured as:
L8686 IP_ADDR:8686
Are there any limitations for JVM debugger when running session over ssh tunnel?
One more thing, when I try to connect, on the server console I can see following log mesage:
Listening for transport dt_socket at address: 8686
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我有相同的场景,一切正常,这是我运行我的 java 应用程序的方式:
可能最相关的部分是 -agentlib 部分。
I have the same scenario and everything is working fine, here is how I run my java app:
probably the most relevant part is the -agentlib one.
您可以尝试使用
L8686 localhost:8686
来代替,因为 JVM 可能会拒绝来自非本地地址的连接?请注意,“localhost”是从服务器角度来看的地址。Can you try
L8686 localhost:8686
instead, as the JVM may be refusing connections from non-local addresses? Note that 'localhost' is the address from the server's point of view.如果 VM 启动或现有调试会话关闭并且 VM 再次开始侦听调试连接,则通常会发生
侦听地址:8686 处的传输 dt_socket
。也许在服务器上运行 tcpdump 可以给出哪个对等方关闭连接的线索,并在这一侧进行更深入的了解。That
Listening for transport dt_socket at address: 8686
usually occurs if the VM is started or an existing debug session is closed and the VM starts listening for a debug connection again. Maybe runningtcpdump
on the server could give a clue which peer closes the connection and look a bit deeper on that side.