使用eclipse远程调试tomcat应用程序
2012-12-21 09:40
639 查看
使用eclipse远程调试tomcat应用程序
背景:程序在本地机上运行没有问题,部署到测试服务器上后出现问题。
在不对代码进行重新部署的前提下如何对服务器上的代码进行debug呢。
答案是:让tomcat以jpda试启动
JPDA:Java Platform Debugger Architecture是 Java 平台调试体系结构的缩写。
在tomcat中关于jpda的设置,请看“catalina.bat”或“catalina.sh”文件,找到以下内容:
rem JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start"
rem command is executed. The default is "dt_socket".
rem
rem JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start"
rem command is executed. The default is 8000.
rem
rem JPDA_SUSPEND (Optional) Java runtime options used when the "jpda start"
rem command is executed. Specifies whether JVM should suspend
rem execution immediately after startup. Default is "n".
rem
rem JPDA_OPTS (Optional) Java runtime options used when the "jpda start"
rem command is executed. If used, JPDA_TRANSPORT, JPDA_ADDRESS,
rem and JPDA_SUSPEND are ignored. Thus, all required jpda
rem options MUST be specified. The default is:
rem
rem -agentlib:jdwp=transport=%JPDA_TRANSPORT%,
rem address=%JPDA_ADDRESS%,server=y,suspend=%JPDA_SUSPEND%
具体过程大概如下:
1 在服务器上打开"start.bat"或"start.sh",找到“call "%EXECUTABLE%" start %CMD_LINE_ARGS%”,在最后几行。
修改为“call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%”,即在start前增加jpda,如果需要设置jpda的参数,请参照“JPDA_OPTS”
2 启动服务器,ok了。下面配制如何在eclipse中远程调试。
3 具体操作见下图。
背景:程序在本地机上运行没有问题,部署到测试服务器上后出现问题。
在不对代码进行重新部署的前提下如何对服务器上的代码进行debug呢。
答案是:让tomcat以jpda试启动
JPDA:Java Platform Debugger Architecture是 Java 平台调试体系结构的缩写。
在tomcat中关于jpda的设置,请看“catalina.bat”或“catalina.sh”文件,找到以下内容:
rem JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start"
rem command is executed. The default is "dt_socket".
rem
rem JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start"
rem command is executed. The default is 8000.
rem
rem JPDA_SUSPEND (Optional) Java runtime options used when the "jpda start"
rem command is executed. Specifies whether JVM should suspend
rem execution immediately after startup. Default is "n".
rem
rem JPDA_OPTS (Optional) Java runtime options used when the "jpda start"
rem command is executed. If used, JPDA_TRANSPORT, JPDA_ADDRESS,
rem and JPDA_SUSPEND are ignored. Thus, all required jpda
rem options MUST be specified. The default is:
rem
rem -agentlib:jdwp=transport=%JPDA_TRANSPORT%,
rem address=%JPDA_ADDRESS%,server=y,suspend=%JPDA_SUSPEND%
具体过程大概如下:
1 在服务器上打开"start.bat"或"start.sh",找到“call "%EXECUTABLE%" start %CMD_LINE_ARGS%”,在最后几行。
修改为“call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%”,即在start前增加jpda,如果需要设置jpda的参数,请参照“JPDA_OPTS”
2 启动服务器,ok了。下面配制如何在eclipse中远程调试。
3 具体操作见下图。
相关文章推荐
- tomcat使用Eclipse进行远程调试(线上调试)
- 使用 Eclipse 远程调试 Java 应用程序(mark)
- 使用 Eclipse 远程调试 Java 应用程序
- 使用 Eclipse 远程调试 Java 应用程序
- 【转】使用Eclipse远程调试发布在Tomcat上的Web应用
- 使用eclipse远程调试tomcat
- 使用Eclipse远程调试Tomcat
- 使用 Eclipse 远程调试 Java 应用程序
- 使用eclipse远程调试tomcat
- 使用 Eclipse 远程调试 Java 应用程序
- 【转】使用 Eclipse 远程调试 Java 应用程序
- 使用Eclipse远程调试发布在Tomcat上的Web应用
- 使用 Eclipse 远程调试 Java 应用程序
- 使用Eclipse进行远程调试(Tomcat远程调试)
- 使用 Eclipse 远程调试 Java 应用程序
- 【转】使用Eclipse远程调试发布在Tomcat上的Web应用
- 使用 Eclipse 远程调试 Java 应用程序
- 使用 Eclipse 远程调试 Java 应用程序
- 用Eclipse远程调试部署在Tomcat下的Web应用程序 .
- 使用 Eclipse 远程调试 Java 应用程序