|
|
|
Remote Debugging OFBiz in EclipseI'm fairly new to Java web development and it took me a little time to figure out how to start debugging OFBiz through Eclipse, so I thought I'd share what I found to speed things up for others. This is the recommended way for debugging ofbiz. Step 1: Run OFBiz in debug modeNormally we start OFBiz with the command line Step 2: Connect to OFBiz with Eclipse as a DebuggerBefore connecting you have to create a new debug configuration.
|
Running (or debugging) OFBiz in Eclipse
- Select OFBiz project, right-click on it -> Run As -> Run ... (alike for Debug)
- Select Java Application and click on New
- Set Run configuration name to OFBiz
- Main tab:
- Project: OFBiz
- Main class: org.ofbiz.base.start.Start
- Arguments:
- VM arguments: -Xms128M -Xmx256M
- Working directory: Use default working directory
- Classpath
- Bootstrap Entries: JRE System Library
- User Entries: ofbiz.jar from OFBiz project
- Environment
- Add environment variable LC_ALL=C (Optional, Linux only)
- Main tab:
- Click on Apply and Run (or Debug)
Test Debugging
- Place a breakpoint on the line "Start start = new Start(args);" which is the first line in main() within the Start.java file
- Go to the OfBiz 'Run' menu and select 'Debug'
- If you hit the breakpoint and can step then you're all set. If you cannot then move onto the the Troubleshooting Section
Troubleshooting Eclipse Breakpoints
There is rumour around the Eclipse discussion groups that this has something to do with the Workspace configuration files when running Eclipse within the Windows environment. The Workaround I have found to be perfectly effective in resetting workspace files is as follows ;
Use a shortcut to eclipse as follows:
C:\eclipse\eclipse.exe -data c:\myworkspace -vm c:\j2sdk1.4.2_01\jre\bin\javaw
This will put your project files in c:\myworkspace (create that directory first). This seems to work best for me, I didn't have much luck with the default project directory.
(Thanks to Mike Bangham who discovered this) | |