cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging Alfresco Tomcat with Eclipse

kirit
Champ on-the-rise
Champ on-the-rise
Hi,
I want to setup the Debugging for my Alfresco project with Eclipse, how can i do this?
29 REPLIES 29

pp20218
Champ in-the-making
Champ in-the-making
Hi,
Thanks for your reply. I have all the code base,eclipse and alfresco in a VM. I am accssing all the application thro Xming.
I checked tomcat and alfresco both running. As per my above step I set the debug statement in catalina.sh. Now when i start alfresco thro putty (./startup.sh) alfresco is not starting.

(1)Is my set DEBUG_OPTS= -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888 is in proper place??
(2) If tomcat is running at 8080 then in the above statement address=8888 or address=8080????

Thanks in advance

mrogers
Star Contributor
Star Contributor
8888

pp20218
Champ in-the-making
Champ in-the-making
Hi ,

My alfresco is installed in Linux machine. I am accessing it remotely. I have added below line in catalina.sh

if [ "$1" = "debug" ] ; then
  if $os400; then
    echo "Debug command not available on OS400"
    exit 1
  else
    shift
DEBUG_OPTS= -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888
export DEBUG_OPTS

    if [ "$1" = "-security" ] ; then
      if [ $have_tty -eq 1 ]; then
        echo "Using Security Manager"
      fi
      shift
      exec "$_RUNJDB" "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \
        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
        -sourcepath "$CATALINA_HOME"/../../java \
        -Djava.security.manager \
        -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
        -Dcatalina.base="$CATALINA_BASE" \
        -Dcatalina.home="$CATALINA_HOME" \
        -Djava.io.tmpdir="$CATALINA_TMPDIR" \
        org.apache.catalina.startup.Bootstrap "$@" start
    else
      exec "$_RUNJDB" "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \
        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
        -sourcepath "$CATALINA_HOME"/../../java \
        -Dcatalina.base="$CATALINA_BASE" \
        -Dcatalina.home="$CATALINA_HOME" \
        -Djava.io.tmpdir="$CATALINA_TMPDIR" \
        org.apache.catalina.startup.Bootstrap "$@" start
    fi
  fi

After adding the above 2 lines. I am not able to run the alfresco client it self.

Can anyone help me how to debug this pls?

Thanks
PP

pp20218
Champ in-the-making
Champ in-the-making
Any help pls?

Thanks

dhalupa
Champ on-the-rise
Champ on-the-rise
If you are trying to remotely debug your local Tomcat installation than you might consider using Sysdeo tomcat plugin. It will allow you to debug without messing with remote debugging and it has a nice feature to reload classes without server restart.

Kind regards,

Denis

pp20218
Champ in-the-making
Champ in-the-making
Hi Denis,

Thanks for your reply.

I am using the same plug in. Can you provide me the steps how to do it?
I am using eclipse 3.5, Apache Tomcat(This is available after I installed Alfresco community edition 3.3g),Linux as the OS.
I have made some changes for the Remote debugging.But every time I am getting session time out error.

Pls help.

Thanks
PP

dhalupa
Champ on-the-rise
Champ on-the-rise
Ah, I just noticed that you have remote machine with Tomcat installation. Sysdeo plugin can not be of any help in that case, you will have to set up remote debugging.
Sorry for misunderstanding..

Kind regards,

Denis

pp20218
Champ in-the-making
Champ in-the-making
Do u have any infos or any help guide which describes how to do the environment setup for this remote debugging?

Thanks in advance

jzaruba
Champ in-the-making
Champ in-the-making
I checked-out downloaded all the projects from SVN and I'm able to build Alfresco, but when trying to launch it (not in Eclipse) Tomcat seems to freeze. There's the hint for Linux installations that one should give more memory to Tomcat when this happens. But how can I do that on Windows with Tomcat 6 please? (There's no catalina.bat or catalina.sh on Tomcat 6.)

Also before I can build my/modified Alfresco I have to make the debugging work, I fail at that too. Smiley Sad
I have some experience with Tomcat and debugging apps for it (in Eclipse using Sysdeo launcher) but until now I was always debugging my own app consisting of single project.
What is the proper way of making the Tomcat in Eclipse 'load' all the projects/parts of Alfresco?

Also I'd like to make sure I do understand what is the difference between "debugging in Eclipse" and "remote debugging in Eclipse".
Does the later mean that Tomcat is not run in Eclipse? What are the benefits or limitations of such debugging please? (Why would one prefer it over being able to see any changes in code almost instantly reflected in the running app?)

pp20218
Champ in-the-making
Champ in-the-making
Hi,

Pls follow the link.It is very cleear for building the code from SVN(http://forums.alfresco.com/en/viewtopic.php?f=10&t=15336).

Also see some help here (http://www.betaquest.com/2010/07/tutorial-installing-alfresco-community-3-3g-on-centos-5-5-x64-with-...)

catalina.bat and catalina.sh you will find in TOMCAT/bin folder.

As per my understanding on "debugging in Eclipse" means your codebase and the developement enc,servers in one machine.
Remote debugging means your server is in remote and dev env in some other machine.

Thanks