转:如何在eclipse中远程调试ofbiz

本文介绍了一种官方推荐的OFBiz调试方法,通过设置特定的命令行参数使OFBiz以调试模式运行,并监听指定端口等待调试器连接。此外,还详细介绍了如何在Eclipse中配置远程调试。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转载地址:http://cwiki.apache.org/confluence/display/OFBIZ/Running+and+Debugging+OFBiz+in+Eclipse

Remote Debugging OFBiz in Eclipse

This is the official recommended way for debugging OFBiz. It's fine. Personnaly (Jacques Le Roux) I use also the second method below Debugging (or running) OFBiz in Eclipse because I find it convenient (but I'm certainly biased having used such tools for a pretty long time now). For instance, it's really helpful when it comes to debug the framework java code. When someone has screwed up the framework java code and you can't load OFBiz. Then it's an easy way to debug OFBiz using inside debugging. Though using the remote debuggind technique, you may also suspend the JVM through the command line options at start up. Effectively the JVM boots, stops and waits for a debugger to connect and then it continues so you can still use remote debugging. Just put suspend=y in the start options alongside the socket and ports settings (thanks Ray)

OFBiz in Eclipse|#debuggingInEclipse]

Step 1: Run OFBiz in debug mode

Normally we start OFBiz with the command line

  %JAVA_HOME%\bin\java -jar ofbiz.jar

To start in debug mode use the command line

  %JAVA_HOME%\bin\java \-Xdebug \-Xnoagent \-Djava.compiler=NONE \-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8091 \-jar ofbiz.jar

This changed command line instructs java to run in debug mode listening for a socket connection on port 8091 for a debugger to connect. You can change the port number to any port not otherwise being used.

Step 2: Connect to OFBiz with Eclipse as a Debugger

Before connecting you have to create a new debug configuration.

  • In Eclipse choose Run->Debug... from the menu. A Debug window should pop up.
  • Select Remote Java Application from the tree on the left.
  • Click New (button on the bottom left).
  • Type a name at the top (OFBiz, perhaps?)
  • On the Connect tab
    • Pick ofbiz for the project
    • Select Standard (Socket Attach) for Connection Type
    • Type localhost for host
    • Type 8091 (or whatever port you chose) for port
  • On the Source tab
    • Click Add Projects... (buttons on the right)
    • Select the ofbiz project
  • Click Apply If you have OFBiz running debug (Step 1 above) you can start debugging by clicking Debug (on the bottom) now.
    You know that you are connected when you see a start/stop button in the debug perspective of Eclipse.

First created by Jarrod Ribble

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值