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
Solved

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

Posted on 2010-09-13
4
955 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
changePi Challenge 15 166
array220 challenge 8 65
strDist challenge 35 127
Where to store the queries for modification of table 4 69
Configure Web Service (server application) I. Configure security for Web Services methods First, we need to protect Session bean which implements the service: 1. Open EJB deployment descriptor (ejb-jar.xml) in the EJB project that contains you…
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
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.

856 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