Solved

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

Posted on 2010-09-13
4
971 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Verbose logging is used to diagnose garbage collector problems. By default, -verbose:gc output is written to either native_stderr.log or native_stdout.log.   It is also possible to redirect the logs to a user-specified file. This article will de…
This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
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.

687 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