JPDA and Set up Tomcat for Remote Debugging

* About JPDA (http://docs.oracle.com/javase/7/docs/technotes/guides/jpda/architecture.html)

JPDA: (Java Platform Debugger Architecture), the following diagram illustrates the architecture,

 

 

* How to setup Tomcat for remote debugging

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, 

call "%EXECUTABLE%" start %CMD_LINE_ARGS%

 Just add "jpda" in frond of "start", that's

call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%

  

This will use the default "JPDA_TRANSPORT" and "JPDA_ADRESS" settings in "bin/catalina.bat",

** set JPDA_TRANSPORT = dt_socket

** set JPDA_ADDRESS=8000

After that, if you start tomcat, you would see the following line from the command console, 

Listening for transport dt_socket at address: 8000

 

 

Then you can set up your IDE (eclipse) to attach to the tomcat, 

  

除了远程debug之外,还有一种在开发阶段很方便的方式就是在eclipse里面直接指定tomcat的运行目录,然后在eclipse里面启动tomcat,这样就可以直接进行debug了。 

第一步: 设置eclipse 

window -> preference -> Tomcat, 然后入下图所示设置tomcat的目录 - 

 

第二步:进行调试 

如下图所示,可以在工具栏上直接双击tomcat的图标进行启动,然后就可以debug了。

转载于:https://www.cnblogs.com/fangwenyu/p/3254786.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值