Wednesday, March 09, 2011

JBoss – Pause at startup until debugger is attached

A tidbit I picked up today at ATG developer training: It’s possible to configure JBoss to pause at startup until a debugger is attached. To do this, specify suspend=y in JAVA_OPTS. (This can be done in <jbossdir>\bin\run.bat.) For example, the relevant line from the run.bat I’m using in the training class:

set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%

With this setting, JBoss will automatically resume startup when it detects that a debugger (e.g. Eclipse) has been attached.

This is useful to be able to debug things that occur while JBoss is starting up.

No comments:

Post a Comment

Non-spammers: Thanks for visiting! Please go ahead and leave a comment; I read them all!

Attention SPAMMERS: I review all comments before they get posted, and I REPORT 100% of spam comments to Google as spam! Why not avoid getting your account banned as quickly -- and save us both a little time -- by skipping this comment form and moving on to the next one on your list? Thanks, and I hope you have a great day!