Sunday, February 1, 2009

Remote Debugging Mule 2.x on Linux

I was having trouble getting my Mule 2.1.1 instance start in debugging mode, until I found this blog entry: Mule Error: Remote Debugging a Mule Server6. The start of my resulting wrapper.conf, with the normal debug line having been broken out into 4:
# Location of your Mule installation.
wrapper.java.additional.1=-Dmule.home="%MULE_HOME%"
wrapper.java.additional.1.stripquotes=TRUE
wrapper.java.additional.2=-Dmule.base="%MULE_BASE%"
wrapper.java.additional.2.stripquotes=TRUE

# Javaagent for certain load time weavers
wrapper.java.additional.3=-javaagent:/opt/mule-2.1.1/lib/user/spring-agent-2.5.3.jar

# Debug remotely, the application will wait for the external debugger to connect.
# original line:
# wrapper.java.additional.4=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
wrapper.java.additional.4=-Xdebug
wrapper.java.additional.5=-Xnoagent
wrapper.java.additional.6=-Djava.compiler=NONE
wrapper.java.additional.7=-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
Then I finally got what I was looking for in my mule.log and was able to attach to port 5005 in Eclipse:
--> Wrapper Started as Daemon
------------------------------------------------------------------------
The JVM is being launched with a debugger enabled and could possibly be
suspended. To avoid unwanted shutdowns, timeouts will be disabled,
removing the ability to detect and restart frozen JVMs.
------------------------------------------------------------------------
Launching a JVM...
Listening for transport dt_socket at address: 5005
Starting the Mule Server...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.

I've tried this on both Ubuntu 8.10 and Linux Mint 6 with Mule 2.1.1.

2 comments: