java远程调试Tomcat app:为什么JVM不能监听? [英] java remote debugging Tomcat app: Why does the JVM not listen?

查看:141
本文介绍了java远程调试Tomcat app:为什么JVM不能监听?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想远程调试在Tomcat 7中运行的应用程序.Tomcat作为Win2008服务器上的服务运行。
我将以下内容添加到Tomcat的Java配置面板中的Java选项:
-Xdebug -Xrunjdwp:transport = dt_socket,address = 4711,server = y,suspend = n 并在我的工作站和此端口的服务器上打开防火墙。
但是当我在我的工作站上尝试从IntelliJ 9进行调试时,我收到一条错误消息无法打开调试器端口:java.net.ConnectException连接超时:连接。 jvm是备用的Sun / Oracle 64位JVM版本1.6.0_27。

I want to remote debug an application running in Tomcat 7. Tomcat is running as a service on a Win2008 server. I added the following to the Java options in the Java Configuration Panel of Tomcat: -Xdebug -Xrunjdwp:transport=dt_socket,address=4711,server=y,suspend=n and opened the firewall on my workstation and the server for this port. But when I try debugging from IntelliJ 9 on my workstation, I get an error message Unable to open debugger port : java.net.ConnectException "Connection timed out: connect". The jvm is the standatd Sun/Oracle 64 bit JVM version 1.6.0_27.

我通过访问 ManagementFactory验证了命令行参数正在使用中部署到Tomcat的应用程序中的.getRuntimeMXBean()。getInputArguments()并将结果记录到日志文件中。
我在我的工作站和服务器上通过Wireshark验证了端口4711上的TCP请求是从我的电脑发送到服务器的,但是没有答案。在服务器上运行 netstat -a 不会显示正在侦听此端口的进程。所以我假设Tomcat / JVM不会启动远程调试。

I verified that the command line parameters are in use by accessing ManagementFactory.getRuntimeMXBean().getInputArguments() within the application deployed to Tomcat and logging the result to the log file. I verified via Wireshark on my workstation and on the server that the TCP request on port 4711 is sent from my pc and arriving on the server, but there is is no answer. Running netstat -a on the server does not show a process listening on this port. So I assume somehow Tomcat/JVM does not start the remote debugging.

推荐答案

你需要把-Xdebug和-Xrunjdwp .. 。在Tomcat服务配置面板的Java面板中的单独的行上。

You need to put -Xdebug and -Xrunjdwp... on separate lines in the Java panel of the Tomcat Service Configuration Panel.

所以:

-Xdebug -Xrunjdwp:transport=dt_socket,address=4711,server=y,suspend=n

不起作用,但是:

-Xdebug
-Xrunjdwp:transport=dt_socket,address=4711,server=y,suspend=n

will。

这篇关于java远程调试Tomcat app:为什么JVM不能监听?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆