* About JPDA (http://docs.oracle.com/javase/7/docs/technotes/guides/jpda/architecture.html)html
JPDA: (Java Platform Debugger Architecture), the following diagram illustrates the architecture,java
* How to setup Tomcat for remote debuggingtomcat
It's quite simple to set up Tomcat for remote debugging. Open "bin/startup.bat", and you would find the following line at the end, oracle
call "%EXECUTABLE%" start %CMD_LINE_ARGS%
Just add "jpda" in frond of "start", that'seclipse
call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%
This will use the default "JPDA_TRANSPORT" and "JPDA_ADRESS" settings in "bin/catalina.bat",socket
** set JPDA_TRANSPORT = dt_socketide
** set JPDA_ADDRESS=8000工具
After that, if you start tomcat, you would see the following line from the command console, ui
Listening for transport dt_socket at address: 8000
Then you can set up your IDE (eclipse) to attach to the tomcat, spa
除了远程debug以外,还有一种在开发阶段很方便的方式就是在eclipse里面直接指定tomcat的运行目录,而后在eclipse里面启动tomcat,这样就能够直接进行debug了。
第一步: 设置eclipse
window -> preference -> Tomcat, 而后入下图所示设置tomcat的目录 -
第二步:进行调试
以下图所示,能够在工具栏上直接双击tomcat的图标进行启动,而后就能够debug了。