windows - 在 IntelliJ Community Edition 和 Tomcat8 上调试 J2EE 应用程序(作为服务运行)

标签 windows debugging tomcat intellij-idea remote-debugging

我搜索了很多有关使用 IntelliJ IDEA Community Edition 远程调试用 Java 编写的 REST API 的内容。

我的设置:

Windows 10 Tomcat 安装为 Windows 服务 Java 8 Intellij 社区 IDE

最后,在谷歌搜索和筛选 SO 之后,找到了一个可行的解决方案。在下面发布。

最佳答案

第一部分. 在 Debug模式下运行 Tomcat

将 Tomcat8 作为服务运行时

  1. 打开{$TOMCAT_HOME}\bin\Tomcat8w.exe

  2. Java > Java Options 下添加以下行以启用调试端口 8001:

-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8001
  1. 重启 Tomcat 服务

第二部分。附加 IntelliJ IDEA 远程调试器

  1. 使用Remote 模板创建新的运行配置。

  2. Configuration > Settings 下,将 Port 更改为 8001

  3. 点击调试图标运行新配置,IDEA 将连接到 Tomcat 的调试端口

致谢:

  1. How to remotely debug the webapplication running on tomcat service?

关于windows - 在 IntelliJ Community Edition 和 Tomcat8 上调试 J2EE 应用程序(作为服务运行),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44109388/

相关文章:

windows - 有没有办法做一个异步FindNextFile?

debugging - 英特尔lij : how to open a library java source and set a breakpoint for debugging?

c++ - 如何调试非确定性内存损坏?

tomcat - 远程调用在 tomcat 上运行的 MBean 操作

java - Servlet 停止而不给出任何异常

python - 在 Python 中获取 windows/system 文件夹位置

c# - 创建 .NET 窗体时 Visual Studio 指定的窗口类名称是什么?

windows - 你如何拥有一个被调用的 bat 文件而不杀死它正在调用的 bat 文件?

java - 从 Eclipse 调试尚未由运行配置启动的 Java 应用程序

web-services - Axis2 中 POJO 参数中的空格编码