eclipse 远程调试
2016-09-27 13:46
225 查看
远程调试Java应用
http://blog.sina.com.cn/s/blog_6e2d53050101j9wy.htmlhttp://www.cnblogs.com/HighFun/archive/2013/06/06/3120256.html
在java-config 中增加如下配置
debug-enabled="true" debug-options="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9009"
其中,suspend的用途:
如果为N,则表示java应用可以先启动运行,然后远程debug可以随时再连接。启动glassfish的日志如下
D:\glassfish-3.1.2.2\glassfish3\glassfish\bin>asadmin start-domain Waiting for domain1 to start ... Successfully started the domain : domain1 domain Location: D:\glassfish-3.1.2.2\glassfish3\glassfish\domains\domain1 Log File: D:\glassfish-3.1.2.2\glassfish3\glassfish\domains\domain1\logs\server. log Admin Port: 4848 Debugging is enabled. The debugging port is: 9009 Command start-domain executed successfully. D:\glassfish-3.1.2.2\glassfish3\glassfish\bin>
如果为Y,则java应用会先挂起,应用无法访问,一直等待远程debug的连接,启动glassfish的日志如下:
D:\glassfish-3.1.2.2\glassfish3\glassfish\bin>asadmin start-domain Debugging is enabled and the server is suspended. Please attach to the debuggin g port at: 9009 Waiting for domain1 to start ......
然后在Eclipse 中开启远程debug,可以调试,并且应用也可以访问,glassfish追加日志如下:
D:\glassfish-3.1.2.2\glassfish3\glassfish\bin>asadmin start-domain Debugging is enabled and the server is suspended. Please attach to the debuggin g port at: 9009 Waiting for domain1 to start ............................
Successfully started the domain : domain1
domain Location: D:\glassfish-3.1.2.2\glassfish3\glassfish\domains\domain1
Log File: D:\glassfish-3.1.2.2\glassfish3\glassfish\domains\domain1\logs\server.
log
Admin Port: 4848
Debugging is enabled. The debugging port is: 9009
Command start-domain executed successfully.
D:\glassfish-3.1.2.2\glassfish3\glassfish\bin>
在Eclipse 配置 remote debug 时, 注意下面的单选框。如果选了,在remote debug 时,如果点击“Terminal”, 会导致java应用的停止,所以此处不要勾选
相关文章推荐
- Eclipse远程调试JBoss应用
- Eclipse高级操作 远程调试
- Eclipse远程调试
- Eclipse与tomcat6实现远程调试
- 使用Eclipse进行远程调试
- Eclipse的远程调试
- JAVA基础学习篇----Eclipse进行(JBOSS)远程调试
- eclipse 远程调试
- eclipse的远程调试(jboss+tomcat)
- Tomcat和Eclipse远程调试
- Eclipse高级操作 远程调试
- 用Eclipse远程调试部署在Tomcat下的Web应用程序
- Eclipse 3.1 中 集成 Tomcat 远程调试
- 使用Eclipse远程调试发布在Tomcat上的Web应用
- Eclipse远程调试之服务器配置(1)
- Websphere+Eclipse远程调试
- 用Eclipse远程调试部署在Tomcat下的Web应用程序
- Eclipse远程调试Weblogic运行的源代码
- ·Tomcat和Eclipse远程调试
- Eclipse远程调试Tomcat