Solved

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

Posted on 2010-09-13
4
941 Views
Last Modified: 2013-12-02
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
Comment
Question by:jgdvishnu
  • 3
4 Comments
 
LVL 3

Expert Comment

by:prakash_parvath
Comment Utility
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
 

Author Comment

by:jgdvishnu
Comment Utility
what changes that I need to make on the eclipse debug side?
0
 
LVL 3

Expert Comment

by:prakash_parvath
Comment Utility
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
 
LVL 3

Accepted Solution

by:
prakash_parvath earned 500 total points
Comment Utility
you can also refer the following link as well.

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

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now