As you already know JBoss 7.1 is released. It is great, it has still many open bugs, but I like it a lot 🙂
If you want to debug your application, which is running on JBoss 7, then you should run JBoss in debug mode. This is very easy. Open a GNU/Linux terminal and execute these commands:
$> cd /path/to/jboss7/bin $> export JAVA_OPTS="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n" $> ./standalone.sh -c standalone-full.xml
JAVA_OPTS already set in environment; overriding default settings with values: -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n ... Listening for transport dt_socket at address: 8787 ... 22:32:45,730 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.0.Final "Thunder" started in 2907ms - Started 168 of 244 services (75 services are passive or on-demand)
OK, server started in debug mode. Now, you have to deploy your application to JBoss 7.
You can deploy your application to JBoss 7 using the new CLI tool (which is really cool):
$> cd /path/to/jboss7/bin $> ./jboss-cli.sh [disconnected /] connect [standalone@localhost:9999 /] deploy /path/to/your/app.war
Check that your application is started and the go to next step.
You can connect your Eclipse (I use Indigo) on debug port (8787) of JBoss and debug your application within Eclipse. Follow this Eclipse path using your mouse 🙂
- Run -> Debug Configurations… -> Remote Java Application -> Right click -> New
- Then on Connect tab, set these Connection Properties:
- Host = localhost
- Port = 8787
- Then select your Project and in Source tab add extra projects or libraries.
- Press Apply button
- Press Debug button
- You are connected!!!
- Add a Breakpoint in your code
- Trigger your application to reach a Breakpoint
- Voila 🙂
Happy hacking 🙂
Democracy Requires Free Software