Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Debugging add-ons via the Roo shell

DZone's Guide to

Debugging add-ons via the Roo shell

· Java Zone ·
Free Resource

Start coding something amazing with our library of open source Cloud code patterns. Content provided by IBM.

Trying to debug your Roo add-ons (which are OSGi bundles)?  Here's a simple way.  Just add the old remote debugger flags to the front of the <code>java</code> invocation of the Roo shell in your roo.sh script (comment out the working version). These are the last two lines of the script. Back up your script file before you do this.  I use:

# Hop, hop, hop...
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 ...
#java -Dis.apple.terminal=$APPLE_TERMINAL $ROO_OPTS -Droo.args="$*" ...

Then, connect to the debugger with your favorite IDE as a remote debugger. I use IntelliJ with port 5005 localhost. I have set this up so that it pauses while starting up, so that I can attach the debugger. You can set suspend=n if you don't want it.

Nice thing is that you can use the osgi start command to load your add-on, set your breakpoint, then stop right in the command that you're executing. Use it to play around with Roo source to find out how their add-ons work.

From http://www.rimple.com/tech/2011/8/23/debugging-add-ons-via-the-roo-shell.html

Use this tool to look at the contents of GitHub and classify code based on the programming language used.  Content provided by IBM Developer.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}