Debugging with Eclipse & JPDA
来源:互联网 发布:数据挖掘专业课程 编辑:程序博客网 时间:2024/05/29 19:38
url:http://docs14.xnat.org/Debugging+with+Eclipse+%26+JPDA
Instrument Tomcat with JPDA
Method A: Modify Tomcat’s Startup
We will modify our Tomcat startup script to pass the JPDA parameter and environment variables, leaving JPDA running whenever we start Tomcat. From our experience, leaving JPDA running on a development machine has no noticeable performance impact (just make sure your JPDA port is properly firewalled).
On Linux/Mac modify your $TOMCAT_HOME/bin/startup.sh from
exec "$PRGDIR"/"$EXECUTABLE" start "$@"
to (feel free to change the port number):
JPDA_ADDRESS=8000JPDA_TRANSPORT=dt_socketecho "Starting with JDPA at $JPDA_ADDRESS"exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"
On Windows, modify your $TOMCAT_HOME/bin/startup.bat from
On Windows, modify your $TOMCAT_HOME/bin/startup.bat from
to
set JPDA_ADDRESS=8000set JPDA_TRANSPORT=dt_socketcall "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%
You can now start Tomcat via startup.sh or startup.bat.
Method B: Single Use Environment Variables
If you do not want to modify Tomcat’s startup script, you can set the JPDA_ADDRESS, JPDA_TRANSPORT as environmental variables on the command line, then launch Tomcat via:
$TOMCAT_HOME/bin/catalina jpda start
Connect Tomcat to JPDA
Create a new Debug Configuration
Select New launch configuration
Configure the Launch Configuration
Set the Port to the JPDA_ADDRESS you set in startup file and make sure that xnat is selected as the project to debug.
Set a Breakpoint & Debug
You can set breakpoints anywhere in the code. Navigate the website, when the breakpoint is hit, you will be prompted to enter the Debug Perspective.
The Debug Perspective allows stepping through the source as well as examining the state of variables.
Debugging Applets with JPDA
You can also use JPDA to debug applets running in the browser. To enable JPDA, go to the Java Control Panel > Java > Java Runtime Settings > View > User > Runtime Parameters
And add the options to enable debugging:
-Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
You can set the address to any free port (we are using 8000 in this example).
If you need to debug the applet startup, classloading, etc, set suspend to y. When you access an applet page, the browser will appear to freeze as the JVM immediately gets suspended waiting for a debugger to connect.
- Debugging with Eclipse & JPDA
- Debugging PL/SQL and Java Stored Procedures with JPDA
- Remote Debugging with Eclipse
- Remote Debugging with Eclipse
- Remote Debugging with Eclipse
- Java Debugging with Eclipse
- Debugging with the Eclipse platform
- Java Debugging with Eclipse - Tutorial
- Debugging with the Eclipse Platform
- Eclipse远程调试(Remote Debugging with Eclipse)
- Remote Debugging for Tomcat with Eclipse
- Top 10 Java Debugging Tips with Eclipse
- Top 10 Java Debugging Tips with Eclipse
- Top 10 Java Debugging Tips with Eclipse
- Tomcat jpda Eclipse
- http://eclipsezone.com/eclipse/forums/t53459.htmlRemote Debugging with Eclipse
- Debugging with the Maven Jetty Plugin in Eclipse
- Debugging with the Maven Jetty Plugin in Eclipse
- 写实材质贴图转换成Q版贴图制作步骤
- 对任意长度的矢量求和
- 怎样看待 12 个月内自学完成 4 年麻省理工学院计算机科学的 33 门课程的 Scott H. Young 所谓的超速学习理论和方法(费曼技巧)以及背后「Get More from Life」的理念
- unix常用命令
- weka 开发
- Debugging with Eclipse & JPDA
- java中用到json
- 双向链表的创建
- frame在360浏览器兼容模式时显示白色
- ios 离线实现
- Linux下安装Nginx1.8.0
- 存储过程和存储函数
- 对#Hello,2015征文#+Android 热敏打印机打印二维码(图片)博客的尝试
- 多进程学习1