eclipse 调试远程 web 应用程序 [英] eclipse debug remote web application

查看:72
本文介绍了eclipse 调试远程 web 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在 eclipse IDE 中开发并导出的 struts2 web 应用程序它作为war文件并将其部署在安装在Windows服务器中的tomcat7中.现在我需要在本地系统内的 Eclipse 中调试这个部署的 Web 应用程序.如何把这些代码带进去?我找到了一些链接,但我坚持如何将这些代码引入eclipse 在我的本地系统中放置断点.

I have a struts2 web application developed in eclipse IDE and exported it as war file and deployed it in tomcat7 installed in windows server. Now I need to debug this deployed web application in eclipse inside my local system. How to bring those codes inside? I found some links but I stuck with how to bring those code into eclipse in my local system to place break points.

这些是几个链接...

链接 1链接 2 链接 3 链接 4

推荐答案

windows 解决方案:

首先你必须修改你的tomcat启动脚本(startup.bat):

First you have to modyfy your tomcat startup script (startup.bat):

把它放在 startup.bat 的顶部

Put this on top of the startup.bat

set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
...

然后修改以下行(几乎在startup.bat的末尾):

Then modyfy the following line (nearly at hte end of startup.bat):

call "%EXECUTABLE%" start %CMD_LINE_ARGS%

call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%

现在可以通过执行startup.bat启动tomcat,tomcat打开8000端口进行调试.

Now you can start tomcat by executing startup.bat and tomcat opens the port 8000 for debuging.

第二步是配置Eclipse:

Second step is to configure Eclipse:

选择运行 > 调试配置...

Select Run > Debug Configurations ...

通过右键单击选择远程 Java 应用程序"来创建新配置.

Create a new configuration by selecting 'Remote Java Application' with a right click.

检查是否选择了正确的项目.

Check that the right Project is selected.

并修改连接属性.(请注意,端口必须与在 startup.bat 中输入的端口相同(8000),而不是运行 struts 应用程序的端口)

And modyfy the Connection properties. (Note that the port has to be same (8000) as entered in startup.bat and not the port on which your struts app is running)

最后你必须点击调试

现在您应该可以设置断点了.

Now you should be able to set breakpoints.

这篇关于eclipse 调试远程 web 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆