• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 995
  • Last Modified:

How to do Remote Debugging of JBoss application in MAC OS(10.6) environment

Problem statement:- want to simplify and understand the flow.

There is a complex old J2EE application which interacts with other client applications through RMI/EJB.

It uses XDoclet and is annotation based. I need to make modification and test everyday. It is very difficult to debug the application as the tar file I have to deploy on remote server and run Unit Test Cases from my local machine. I use eclipse but I find very complex to check as the only tool to check is the logs and search the call hierarchy.

To make a small change and do unit test takes days.  I need a simper easy to use approach.
Environment:- Java1.5,  Mac OSX(10.6), Unix, Eclipse Galielo (Work Bench), JBoss
0
jgdvishnu
Asked:
jgdvishnu
  • 3
1 Solution
 
prakash_parvathCommented:
you must first launch it with debugging enabled and attach to the server from the debugger through a JPDA port (Default port is 1044).

The default JPDA options for J2EE servers are as follows:

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044


Debugging JBoss

change run.sh located under JBOSS_HOME/bin.

With the following

 $ cd /var/jboss4/bin
 $ sh ./run.sh
 =========================================================================

 JBoss Bootstrap Environment
 
 JBOSS_HOME: /var/jboss4
 
 JAVA: /usr/java/j2sdk1.4.2_06/bin/java
 
 JAVA_OPTS: -server -Xms128m -Xmx128m -Dprogram.name=run.sh
 
 DEBUG_OPTS = -Xdebug -Xrunjdwp:transport= dt_socket,address=1044,server=y,suspend=n
 
 CLASSPATH: /var/jboss4/bin/run.jar:/usr/java/j2sdk1.4.2_06/lib/tools.jar


P.S : change jboss version, jdk versions according to yours :)
0
 
jgdvishnuSoftware ArchitectAuthor Commented:
what changes that I need to make on the eclipse debug side?
0
 
prakash_parvathCommented:
Hi do these from Eclipse end,  

 1. In Eclipse, navigate to Run | Debug (See Figure 2: Create new Remote Java Application configuration in Eclipse ).
   2. Select Remote Java Application , on the left column. Click New , on the bottom of the same column.
   3. In the Create configuration screen you'll be prompted to enter some values. Start with a meaningful name. In my case that's JBossInstance . For Project, select the Java project that contains the source code you want to debug. Leave Connection Type in default, i.e. Standard (Socket Attach) . For Host , enter localhost. If you want to debug a remote server, enter its hostname or IP address. For port, enter 1044 or the port you defined in your JBossstartup script.
   4. Click Apply
   5. Make sure JBossinstance is running in debug mode. In the same screen click Debug . Eclipse should automatically take you to the Debug perspective and you should see a stack trace in the Debug view.
   6. If you are not automatically taken to the Debug perspective, select Window | Open Perspective | Other and then click Debug.

Hope this helps.
0
 
prakash_parvathCommented:
you can also refer the following link as well.

http://oreilly.com/java/archive/eclipse-jboss-remote-debug.html
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now