Page 1 of 1

Debug java class files in Eclipse IDE

Posted: Thu Jun 25, 2015 11:55 am
by shantanu
Is there any way by which I can debug the Broadleaf 4.0 code in java class?

Re: Debug java class files in Eclipse IDE

Posted: Thu Jun 25, 2015 3:09 pm
by phillipuniverse
Yes, if you're in Eclipse you can hit CTRL + SHIFT + T (on Windows/LInux, on OSX it's CMD + SHIFT + T) to open a Broadleaf class and then set a breakpoint in one of those classes.

In order to debug you have to hook up a remote debugger in Eclipse to port 8000 (frontend site) or 8001 (backend admin)

Are you having some other problem with doing that?

Re: Debug java class files in Eclipse IDE

Posted: Sun Jun 28, 2015 12:36 am
by shantanu
Can you please explain the steps to hook up a remote debugger in Eclipse to port 8000 (frontend site) or 8001 (backend admin)?
Also mention the changes in various files which would be required to setup the remote debugger.

Thanks in advance

Re: Debug java class files in Eclipse IDE

Posted: Sun Jun 28, 2015 10:54 pm
by phillipuniverse
There are no file changes necessary to set up a debugger.

In Eclipse, hit the little down arrow to the right of the debug icon and go to "Debug Configurations": http://cl.ly/image/233x0R2N0J3C. That will bring up the debug configurations window. Go down to 'Remote Java Application", right click and hit 'New': http://cl.ly/image/1a2R252U1M3P. Most of the defaults here are fine (port 8000, localhost, etc) http://cl.ly/image/3m0F3c3f1G1W. You'll want to make sure that you have the right project selected (by hitting the browse button) and then name it something like 'Broadleaf Site'. Then create another debug configuration but this time use port 8001 and call it 'Broadleaf Admin' and select your admin project.

Then you can hit the 'Debug' button on the bottom-right of the window to start debugging. If you have a breakpoint set in any file (Broadleaf classes or your own classes) then the little blue button will have a checkbox by it indicating that the breakpoint is set up correctly.