cancel
Showing results for 
Search instead for 
Did you mean: 

Remote Debugging with Eclipse

ghernando
Champ in-the-making
Champ in-the-making
What must I set in the development environment to enable remote debugging of the server code in Eclipse?

Thanks!
31 REPLIES 31

chrisokelly
Champ on-the-rise
Champ on-the-rise
Sweet! Let us know how it goes!

Hey,

It was a little more work than I thought at first but it's going now Smiley Happy.
My alfresco.sh script did not have support for a jpda argument, it's just the one from the default quick installer, so if anyone else needs it here's what I used to make the scripts work -


in alfresco.sh, between
    elif [ "x$2" = "xjetty" ]; then
        if test -x $JETTY_SCRIPT; then
            $JETTY_SCRIPT start
            JETTY_ERROR=$?
        fi
and
    else
        if test -x $MYSQL_SCRIPT; then
            $MYSQL_SCRIPT start
            MYSQL_ERROR=$?
            sleep 5
        fi
I added
    elif [ "x$2" = "xjpda" ]; then
            $POSTGRESQL_SCRIPT start
            POSTGRESQL_ERROR=$?
            sleep 5
            $TOMCAT_SCRIPT jpda
            TOMCAT_ERROR=$?
            $OPENOFFICE_SCRIPT start
            OPENOFFICE_ERROR=$?
Edit: just realized, this bit may be different depending on the environment, but essentially just look at the other if…fi statements around it and copy in the ones that apply to you. I know that with a bit of work I could have included the test -x lines necessary to automatically run whatever is installed but this is all I really needed for our install.

In tomcat/scripts/ctl.sh, between
is_tomcat_running() {
    get_tomcat_pid
    is_service_running $PID
    RUNNING=$?
    if [ $RUNNING -eq 0 ]; then
        TOMCAT_STATUS="tomcat not running"
    else
        TOMCAT_STATUS="tomcat already running"
    fi
    return $RUNNING
}
and
if [ "x$1" = "xstart" ]; then
    start_tomcat
    sleep 2
I added
jpda_tomcat() {
    export JAVA_OPTS="-XX:MaxPermSize=512m -Xms128m -Xmx1024m -XX:-DisableExplicitGC -Dalfresco.home=/opt/alfresco-4.0.d -Dcom.sun.management.jmxremote -Dsun.security.ssl.allowUnsafeRenegotiation=true"
    export JAVA_HOME=$JRE_HOME
    $TOMCAT_BINDIR/catalina.sh jpda start
}
and between

if [ "x$1" = "xstart" ]; then
    start_tomcat
    sleep 2
and
elif [ "x$1" = "xdaemon" ]; then
    daemon_tomcat
I added
elif [ "x$1" = "xjpda" ]; then
    jpda_tomcat
    sleep 2

I can now use
sudo ./alfresco.sh start jpda
to start alfresco in debug mode.

Thanks for all the help guys!

jmuras
Champ in-the-making
Champ in-the-making