The best place to ask programming/development questions, imo. UPDATE: stackoverflow is the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but a great reference for finding answers.

My Music (Nickleus)

20111222

How to enable remote debugging with Jboss and Eclipse on Ubuntu Linux


1. enable debugging in run.sh (e.g. /usr/jboss/bin/run.sh )

insert this code:

## uncomment this to enable debugging
JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n"


right before this code:

# Display our environment
echo "========================================================================="
echo ""
echo "  JBoss Bootstrap Environment"
echo ""
echo "  JBOSS_HOME: $JBOSS_HOME"
echo ""
echo "  JAVA: $JAVA"
echo ""
echo "  JAVA_OPTS: $JAVA_OPTS"
echo ""
echo "  CLASSPATH: $JBOSS_CLASSPATH"
echo ""
echo "========================================================================="
echo ""


2. restart jboss

3. make sure jboss is listening on port 1044

on ibmserver, open a terminal window and run this code:
netstat -a|grep 1044

if a line like this turns up then you're ok:
tcp 0 0 *:1044 *:* LISTEN

4. create new Remote Java Application in eclipse (i.e. configure eclipse so it can debug and publish to a remote java application from your remote location and source code project)

in eclipse (e.g. helios):
run > debug configurations
right click remote java application > new

for name write e.g. myRemoteServer trunk

in the connect tab:
for project click the browse button and choose the root of your trunk eclipse project, e.g. myProjectTrunk

for host use the remote ip address, e.g. 192.168.1.238 (for trunk on myRemoteServer)

for port use the port you specified in run.sh, e.g. 1044

click the apply button, then the debug button

sources:
http://www.eclipsezone.com/eclipse/forums/t53459.html
http://community.jboss.org/thread/78131