使用Eclipse远程调试Tomcat
来源:互联网 发布:浮云淘宝小号 编辑:程序博客网 时间:2024/06/05 11:06
前提条件: tomcat所在的服务器为linux系统。
一、设置tomcat
1、第一种方式
使用如下命令启动tomcat, 它就会监听8000端口(默认端口),等待调试器的连接。
./catalina.sh jpda start
要注意不能使用 startup.sh脚本。
tomcat会使用 JPDA_ADDRESS这个环境变量的值。比如想监听8017端口:
export JPDA_ADDRESS=8017
2、第二种方式
在tomcat/bin/catalina.sh中的正文开始部分添加如下内容:
CATALINA_OPTS="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8999"
三、在eclipse设置
1.右键点击“debug configutations”。
2.在对话框里找到“Remote Java Application”。 右键菜单选择“New”创建一个配置。
3.新创建的配置的Project选择服务器上的工程。Host和Port分别填写你服务器的IP和JPDA的端口
现在就可以像本机调试一样, 设置断点和跟踪调试了
四、可能遇到的问题及处理办法:
1、报Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
处理办法:
则在catalina.sh中加入:
export JAVA_HOME=/opt/tuniu/jdk
export JRE_HOME=$JAVA_HOME/jre
2、ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.
Error occurred during initialization of VM
agent library failed to init: jdwp
处理办法:
则删除catalina.sh中的:
CATALINA_OPTS="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8999"
参考 http://www.oschina.net/question/12_8196
一、设置tomcat
1、第一种方式
使用如下命令启动tomcat, 它就会监听8000端口(默认端口),等待调试器的连接。
./catalina.sh jpda start
要注意不能使用 startup.sh脚本。
tomcat会使用 JPDA_ADDRESS这个环境变量的值。比如想监听8017端口:
export JPDA_ADDRESS=8017
2、第二种方式
在tomcat/bin/catalina.sh中的正文开始部分添加如下内容:
CATALINA_OPTS="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8999"
三、在eclipse设置
1.右键点击“debug configutations”。
2.在对话框里找到“Remote Java Application”。 右键菜单选择“New”创建一个配置。
3.新创建的配置的Project选择服务器上的工程。Host和Port分别填写你服务器的IP和JPDA的端口
现在就可以像本机调试一样, 设置断点和跟踪调试了
四、可能遇到的问题及处理办法:
1、报Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
处理办法:
则在catalina.sh中加入:
export JAVA_HOME=/opt/tuniu/jdk
export JRE_HOME=$JAVA_HOME/jre
2、ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.
Error occurred during initialization of VM
agent library failed to init: jdwp
处理办法:
则删除catalina.sh中的:
CATALINA_OPTS="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8999"
参考 http://www.oschina.net/question/12_8196
0 0
- 使用eclipse远程调试tomcat
- 使用Eclipse远程调试Tomcat
- 使用Eclipse远程调试Tomcat
- 使用eclipse远程调试tomcat
- 使用Eclipse远程调试Tomcat
- 使用eclipse远程调试tomcat
- 使用Eclipse远程调试Tomcat
- 使用eclipse远程调试tomcat
- 使用Eclipse进行远程调试(Tomcat远程调试)
- 使用eclipse远程调试tomcat应用程序
- 使用Eclipse+tomcat进行远程调试
- Eclipse远程调试Tomcat
- eclipse远程调试tomcat
- Eclipse远程调试Tomcat
- Eclipse远程调试Tomcat
- Eclipse远程调试Tomcat
- ECLIPSE远程调试TOMCAT.
- Eclipse远程调试Tomcat
- 一个很多资料的FTP服务器
- Java学习之位运算符
- android 如何修改自定义dialog的宽度
- android onNewIntent
- 二叉堆的插入删除等操作C++实现
- 使用Eclipse远程调试Tomcat
- CSS 基础和高级的指南或资源
- SharePoint安全 - SharePoint网站常用页面URL索引
- Vim简单的查找替换
- Spring容器和被管理的Bean
- not in与not exists的区别
- onCreateOptionsMenu 和onOptionsItemSelectedu
- poj-1703 find them,catch them!
- dede后台密码忘记了,怎么办