Results 1 to 4 of 4

Thread: Remote debugging info

  1. #1
    Join Date
    Sep 2005
    Rep Power

    Default Remote debugging info

    Here are the steps required to connect a remote debugger to the ZCS server. On the server:
    zmlocalconfig tomcat_java_options
    This returns the current JVM options that we pass to Tomcat.
    zmlocalconfig -e tomcat_java_options="<current JVM options> -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n"
    (Remove spaces before "suspend=n". I have no idea why the forum app puts them there).

    If you need to debug code that runs during server startup, specify suspend=y instead. Note that if you do this, server startup will hang until a remote debugging session attaches to it. Feel free to use a different port number if you like.

    Restart the server and make sure you're still able to read mail.

    On the client:
    • Make sure that your source is synced to the same timestamp as the server build.
    • In Eclipse, choose the Run / Debug... menu option.
    • Choose Remote Java Application and click the New button.
    • Set Name to "Remote", Host to the hostname and Port to 8000.
    • Click Close.

    Now if you ever need to debug the server, click on the down arrow next to the bug icon and choose "Remote". If you don't want to use Eclipse, connect to the server on port 8000 using any standard JDWP debugger.
    Last edited by bburtin; 01-11-2006 at 10:51 AM. Reason: Typo in zmlocalconfig example

  2. #2
    Join Date
    Sep 2005
    Rep Power


    I just realized that our tomcat launcher is rejecting the -Xdebug JVM option, so the directions above will not work. I'll post a followup message once I figure out an elegant way around this.

  3. #3
    Join Date
    May 2006
    Rep Power


    If you follow the instructions above, an error message appears in catalina.out:
    zmtomcatstart: error: JVM option: -Xdebug: not allowed

    As a workaround, you can:
    1. edit ZimbraNative/src/launcher/zmtomcatstart.c
    2. add -Xdebug and -Xrunjdwp to the AllowedJVMArgs array
    3. rebuild and install zmtomcatstart

    tomcat then listens on port 8000 and you are happily debugging.

  4. #4
    Join Date
    Feb 2006
    Auckland, New Zealand
    Rep Power

    Default Another way

    If you don't want to recompile C source, you can start tomcat with these parameters and also attach remotely. (This is for 3.1.4 BTW)


    /opt/zimbra/jdk1.5.0_06/bin/java -Xms303m -Xmx303m  -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -client -XX:NewRatio=2 -Dcatalina.base=/opt/zimbra/apache-tomcat-5.5.15 -Dcatalina.home=/opt/zimbra/apache-tomcat-5.5.15 -Djava.library.path=/opt/zimbra/lib/jars -Djava.endorsed.dirs=/opt/zimbra/apache-tomcat-5.5.15/common/endorsed -classpath /opt/zimbra/apache-tomcat-5.5.15/bin/bootstrap.jar:/opt/zimbra/apache-tomcat-5.5.15/bin/commons-logging-api.jar org.apache.catalina.startup.Bootstrap start

Similar Threads

  1. postfix stopped
    By riegersteve in forum Administrators
    Replies: 1
    Last Post: 05-15-2007, 03:25 PM
  2. Can't start Zimbra!
    By zibra in forum Administrators
    Replies: 5
    Last Post: 03-22-2007, 11:34 AM
  3. Mails accumulating in deferred queue
    By NIRMESH KUMAR in forum Administrators
    Replies: 10
    Last Post: 03-19-2007, 12:17 AM
  4. Web client logon fails (INVALID_PDU)
    By jermxx in forum Installation
    Replies: 8
    Last Post: 02-20-2007, 01:20 PM
  5. The mailbox and mta dies in FC4 GA version
    By meikka in forum Installation
    Replies: 72
    Last Post: 03-16-2006, 04:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts