远程调试 Jetty(无 mvn,无插件)
过去的场景
- 使用 Tomcat 并使用 Eclipse 以调试模式和远程调试启动。
- 定义一个端口并在此调试/远程端口中与 eclipse 连接。
- 用于调试其他主机/服务器中的服务器
今天的场景
现在,我正在使用Jetty,并且我尝试做同样的事情,但没有成功,有人可以帮助我吗?
我没有使用 Maven,也不想从 Eclipse 中启动 Jetty。
环境:
Windows XP
Java V.5
Jetty V. 6.1.15
链接:
http://docs.codehaus.org/display/JETTY/Debugging
这对我没有帮助!
http://docs.codehaus.org/display/JETTY/Debugging+Jetty+with+Eclipse
http://neelzone.wordpress.com/2007/06/18/jetty-and-eclipse-integration
这些是在内部 Eclipse 中启动的
Past scenario
- Work with Tomcat and start in debug mode and Remote Debug with Eclipse.
- Define a port and connect with eclipse in this debug/remote port.
- Use to debug servers in other hosts/servers
Today scenario
Now, I'm using Jetty and I've try to do the same, but with no success, could anyone help-me with that?
I did not use Maven, and did not want to start Jetty inside from my Eclipse.
Environment:
Windows XP
Java V. 5
Jetty V. 6.1.15
Links:
http:// docs.codehaus.org/display/JETTY/Debugging
This did not help me!
http:// docs.codehaus.org/display/JETTY/Debugging+Jetty+with+Eclipse
http:// neelzone.wordpress.com/2007/06/18/jetty-and-eclipse-integration
These are to start inside Eclipse
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是我们在开发时添加到 JBoss 命令行中的内容:
然后我们启动 eclipse 远程调试并连接到该端口。
更新:
要从 jar (独立)运行,请执行以下操作
This is what we are adding to our JBoss command line while development:
Then we launch the eclipse remote debugging and connection to this port.
Update:
To run from jar (standalone) do the following
对于远程调试,您应该使用 JPDA。 有一篇关于它的教程文章 此处。
简而言之,使用以下参数启动 JVM:
并且您可以通过标准 Eclipse 调试器连接到侦听端口 8000 的底层 JVM。
For remote debugging you should use JPDA. There's a sort of tutorialish article about it available here.
In short, start your JVM with the argument:
and you are able to connect to the underlying JVM listening on port 8000 via the standard Eclipse debugger.
如果您有一天要使用 mvn jetty:run,则必须
附加
-Xdebug ...
不起作用If you will use mvn jetty:run one day, you have to
appending
-Xdebug ...
doesn't works在“start.jar”之前使用 JVM“agentlib”命令行参数对我不起作用,但这确实有效:
How to allowed Eclipse to Remote debug #Jetty (#JPDA #agentlib:jdwp) on port 8000
You have to create文件 $JETTY_BASE/start.ini (不要更改 $JETTY_HOME/start.ini),并将以下两行放入其中:
Using the JVM "agentlib" command-line parameter before "start.jar" did not work for me, but this does:
How to allow Eclipse to remotely debug #Jetty (#JPDA #agentlib:jdwp) on port 8000
You have to create a file, $JETTY_BASE/start.ini (do not change $JETTY_HOME/start.ini) and put the following two lines in it: