opencms 远程调试

Debugging

From OpenCms Wiki

Jump to: navigation , search

[edit ] Remote debugging

You can easily debug OpenCms within your IDE if it supports remote debugging. Your Servlet Container needs to be started with JPDA (Java Platform Debugger Architecture) support enabled. To achieve this for Tomcat, simply start it with

catalina.sh|bat jpda start

instead of

catalina.sh|bat start

For Tomcat, the jpda option enables the following startup options to the JVM:

-Xdebug -Xrunjdwp:transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=n

Defaults:

  • JPDA_TRANSPORT: dt_socket
  • JPDA_ADDRESS: 8000

When Tomcat is started this way, you can attach your debugger in your IDE to the running Tomcat JVM process.

[edit ] Eclipse setup

If you have the OpenCms source code in an Eclipse project you can easily set breakpoints and debug the running OpenCms.

Create a new debug configuration in Run/Debug.../Remote Java Application:

  • enter a name,
  • select the project which contains the OpenCms source code
  • make sure the port is correct. (The defaults of Eclipse and Tomcat are identical so you normally do not have to customize it)

After that, set a breakpoint and run the debug configuration. Eclipse then attaches to the remote running Tomcat process and will show the current stack in the Debug perspective.

 

我在自己机器上,试验过了,好像不行,老是报错。google了以后发现貌似是1.5的一个bug,但是,把catalina.sh里面

-Xdebug -Xrunjdwp:transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=n

这段参数删掉就可以了,用它默认的配置就好了,管他呢,反正work!就可以了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值