作为 Windows 服务安装时,启动带有远程调试 (jdwp) 的 Tomcat

发布于 2024-08-04 13:53:15 字数 368 浏览 8 评论 0原文

我安装了 Tomcat 作为 Windows 服务。我想将其配置为支持通过 jdwp 进行远程调试。

从命令行 (catalina.bat) 启动它时,我可以添加此字符串以允许调试:

-agentlib:jdwp=transport=dt_socket,suspend=n,server=y,address=10000

Where can I linked jdwp support when running it as a windows service?出于这个问题的目的,我不想使用“Monitor Tomcat”应用程序,而是通过一些文件(如 server.xml、catalins.properties 等)配置它......

I have a Tomcat installed as a Windows service. I'd like to configure it to support remote debugging via jdwp.

When starting it from the command line (catalina.bat), I can add this string to allow debugging:

-agentlib:jdwp=transport=dt_socket,suspend=n,server=y,address=10000

Where can I added jdwp support when running it as a windows service? For the purpose of this question, I do not want to use the "Monitor Tomcat" application, but rather configure it via some file like server.xml, catalins.properties, etc ...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

柠檬 2024-08-11 13:53:15

以调试模式启动 Tomcat Windows 服务的步骤:

1) 进入Tomcat bin文件夹下的目录
2) C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\bin
3)运行tomcat7w.exe
4) 在 Java/Java 选项下,在所有 -D 选项上方输入行
-Xdebug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

确保以上两行位于单独的行中

Steps to start Tomcat windows service in Debug mode:

1) Go to Directory under Tomcat bin folder
2) C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\bin
3) Run tomcat7w.exe
4) Under Java/ Java Options, enter lines above all the -D options
-Xdebug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

Make sure the above 2 lines are in separate lines

通知家属抬走 2024-08-11 13:53:15

请参阅此操作方法并修改提供的服务.bat 包含以下行:

set JVM_OPTIONS=-Djava.io.tmpdir=%TMPDIR%;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed;-Xms256M;-Xmx512M;-Xmixed;-Xincgc;-Xdebug;-Xrunjdwp:transport=dt_socket,server=n,suspend=y,address=127.0.0.1:4153

这是 JVM_OPTIONS 的第一个设置。确保您不会覆盖已设置的选项。

像往常一样运行service.bat来安装调试服务

see this how-to and modify the provided service.bat to include the following line:

set JVM_OPTIONS=-Djava.io.tmpdir=%TMPDIR%;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed;-Xms256M;-Xmx512M;-Xmixed;-Xincgc;-Xdebug;-Xrunjdwp:transport=dt_socket,server=n,suspend=y,address=127.0.0.1:4153

this is the first setting of the JVM_OPTIONS. make sure you dont overwrite options already set.

run the service.bat as usual to install the debug service

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文