Solved

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

Posted on 2010-09-13
4
950 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
ID: 33672159
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
ID: 33694680
what changes that I need to make on the eclipse debug side?
0
 
LVL 3

Expert Comment

by:prakash_parvath
ID: 33714736
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
ID: 33714740
you can also refer the following link as well.

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

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What is JNDI datasource in spring 1 62
listing all functions in JavaScript 19 201
jdbc error in jsp application 20 45
eclipse buid path vs tomcat lib path 10 23
There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
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.

773 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