Over a million developers have joined DZone.

Debugging add-ons via the Roo shell

· Java Zone

Microservices! They are everywhere, or at least, the term is. When should you use a microservice architecture? What factors should be considered when making that decision? Do the benefits outweigh the costs? Why is everyone so excited about them, anyway?  Brought to you in partnership with 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

Discover how the Watson team is further developing SDKs in Java, Node.js, Python, iOS, and Android to access these services and make programming easy. Brought to you in partnership with IBM.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

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

{{ parent.tldr }}

{{ parent.urlSource.name }}