hlantian的博客园

导航

 

转自网址: http://borderjs.blogspot.com/2007/04/eclipes-tomcat-debugfailed-to-connect.html

 

方法一: 修改配置文件catalina.bat , startup.bat
1. 在环境变量中添加 jpda_address=8000, 也可以加到 startup.bat 文件 @echo off下面如:set jpda_address=8000
2.
打开catalina.bat,在文件中找到" set JPDA_TRANSPORT ",把它的值设为dt_socket
3.
打开startup.bat, 在文件中找到"call "%EXECUTABLE%" start %CMD_LINE_ARGS% ",
改为" call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS% ",
也就是在start前加jpda .
4. 在eclipse debug中选择" Remote Java Application " ,新建一个批port为jpda_address的值 ,

方法二: 通过GUI的"
Configure Tomcat ".
b) Select the Java tab
c) Into the Java Options include (substituting the correct locations)
-Xdebug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
-Dcatalina.home=c:/tomcat
-Djava.endorsed.dirs=c:/tomcat/common/endorsed
-Djava.io.tmpdir=c:/tomcat

NB: These are all on separate lines, with a <CR> at each EOL
d) Select the Startup tab
e) Into the Arguments section include:
jpda
start

NB: These are all on separate lines, with a <CR> at each EOL
其中要注意<CR>

参考:
Failed to connect to remote VM. Connection refused
http://forum.java.sun.com/thread.jspa?threadID=752624

Debugging with Tomcat and Eclipse using jpda
http://www.eaves.org/blog-archive/000246.html

posted on 2010-01-20 14:23  hlantian的博客园  阅读(465)  评论(0编辑  收藏  举报