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

Learn how to troubleshoot and diagnose some of the most common performance issues in Java today. Brought to you in partnership with AppDynamics.

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

Understand the needs and benefits around implementing the right monitoring solution for a growing containerized market. Brought to you in partnership with AppDynamics.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

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

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}