Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
  #1 (permalink)  
Old 01-10-2006, 04:54 PM
bburtin bburtin is offline
Zimbra Employee
 
Join Date: Sep 2005
Posts: 67
bburtin is on a distinguished road
Default Remote debugging info

Here are the steps required to connect a remote debugger to the ZCS server. On the server:
Code:
zmlocalconfig tomcat_java_options
This returns the current JVM options that we pass to Tomcat.
Code:
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
Reply With Quote
  #2 (permalink)  
Old 01-11-2006, 11:34 AM
bburtin bburtin is offline
Zimbra Employee
 
Join Date: Sep 2005
Posts: 67
bburtin is on a distinguished road
Default

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.
Reply With Quote
  #3 (permalink)  
Old 05-24-2006, 01:35 AM
ljm ljm is offline
Senior Member
 
Join Date: May 2006
Posts: 52
ljm is on a distinguished road
Arrow

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.
Reply With Quote
  #4 (permalink)  
Old 10-16-2006, 01:43 PM
kiwicmc kiwicmc is offline
Senior Member
 
Join Date: Feb 2006
Location: Auckland, New Zealand
Posts: 54
kiwicmc is on a distinguished road
Send a message via MSN to kiwicmc
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)

C

Code:
/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.io.tmpdir=/opt/zimbra/apache-tomcat-5.5.15/temp -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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


freshmeat.net sourceforge.net The best Java IDE



 

Search Engine Optimization by vBSEO 3.0.0