Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: source level debugging

  1. #1
    liyingchang is offline Intermediate Member
    Join Date
    Nov 2005
    Posts
    24
    Rep Power
    9

    Default source level debugging

    Hi I am getting myself familiar with the server now after spending 2 days building the latest from CVS and starting it up. I am just wondering how I should go about tracing through the code. I can't seem to start server/tomcat with -Xdebug ...etc.

    any hint is appreciated.

  2. #2
    KevinH's Avatar
    KevinH is offline Expert Member
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    Well you could run tomcat in eclipse(ie start it running under the debugger).
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  3. #3
    liyingchang is offline Intermediate Member
    Join Date
    Nov 2005
    Posts
    24
    Rep Power
    9

    Default

    you mean there is no way for me to start the server with remote debugging capability ? by no means I'd like to poke into propiatory secrets but is that how u guys debug by starting tomcat manually with some configuration to tell it where the zimbra stuff is at ? (as u can tell I am no tomcat expert)

  4. #4
    anand is offline Zimbra Employee
    Join Date
    Sep 2005
    Posts
    274
    Rep Power
    10

    Default

    I don't run tomcat from inside eclipse, so I can't comment on that - others here do, and they may comment on that.

    wrt being able to use -Xdebug in the tomcat/jvm command line, you can do this by using zmlocalconfig to change tocmat_java_options (make sure you preserve current values and reuse them - there is no append in zmlocalconfig).

    Another thing to be aware of - if you are running production install, some JVM options are not allowed (for setuid/security reasons, -Xrun specifically being one of them; see source in ZimbraNative/src/launcher). Make sure you are using the "ZimbraServer/src/bin/tomcat" and not "tomcat.production" script to start/stop tomcat.

  5. #5
    liyingchang is offline Intermediate Member
    Join Date
    Nov 2005
    Posts
    24
    Rep Power
    9

    Default

    ok, thanks for the info, I did the following:

    1. replaced ~zimbra/bin tomcat script with the "tomcat" script to make sure that I am not running the production script.
    2. added -Xdebug and others (with zmlocalconfig):
    tomcat_java_options = -client -XX:NewRatio=2 -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y ,suspend=n

    now the mailbox refuses to start, the status is always "stopped". did I miss something ?

  6. #6
    tim brennan is offline Zimbra Employee
    Join Date
    Sep 2005
    Posts
    93
    Rep Power
    9

    Default Running tomcat inside of eclipse

    Running it inside of eclipse is a huge help: you can change code on the fly (no restart), integrated debugging, etc.

    Many of the devs here use the sysdeo tomcat plugin:
    http://www.sysdeo.com/eclipse/tomcatplugin

    My configuration looks like this....it might not all be necessary, but this is what is running on my box:

    Windows/Preferences/Tomcat:
    Tomcat version: 5.x
    Tomcat home: \opt\zimbra\tomcat
    Configuration file: \opt\zimbra\tomcat\conf\server.xml

    Windows/Preferences/Tomcat/Advanced:
    Tomcat base: \opt\zimbra\tomcat
    Add Java Projects to classpath: ZimbraServer is checked

    Windows/Preferences/Tomcat/JVM Settings:
    add [ZimbraServerPath]\conf to the Classpath

    Windows/Preferences/Tomcat/Source Path:
    ZimbraServer is checked


    Note that there is a problem with the build.xml "deploy" task and the eclipse plugin: if you use the deploy task (or reset-the-world which calls deploy) you will need to stop and restart your server b/c of an issue with the SessionCache class not being properly reinitialized.

  7. #7
    liyingchang is offline Intermediate Member
    Join Date
    Nov 2005
    Posts
    24
    Rep Power
    9

    Default

    Thanks for the info, that's a lot of help, I was able to "start" the tomcat until the following error. Now that I understand it's not related to Zimbra stuff at all and I should be browsing around and find answers somewhere, but just in case you have seen this before and know some answers so I can move forward faster, any input is appreciated.

    1 INFO [main] [] Http11Protocol - Initializing Coyote HTTP/1.1 on http-80
    1711 INFO [main] [] Http11Protocol - Initializing Coyote HTTP/1.1 on http-7071
    1711 INFO [main] [] Catalina - Initialization processed in 4220 ms
    1848 INFO [main] [] StandardService - Starting service Catalina
    1867 INFO [main] [] StandardEngine - Starting Servlet Engine: Apache Tomcat/5.5.7
    2119 INFO [main] [] StandardHost - XML validation disabled
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:271)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:409)
    Caused by: javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
    at javax.xml.parsers.DocumentBuilderFactory.newInstan ce(DocumentBuilderFactory.java:104)
    at org.apache.commons.modeler.util.DomUtil.readXml(Do mUtil.java:284)
    at org.apache.commons.modeler.modules.MbeansDescripto rsDOMSource.execute(MbeansDescriptorsDOMSource.jav a:130)
    at org.apache.commons.modeler.modules.MbeansDescripto rsDOMSource.loadDescriptors(MbeansDescriptorsDOMSo urce.java:120)
    at org.apache.commons.modeler.Registry.load(Registry. java:819)
    at org.apache.commons.modeler.Registry.loadDescriptor s(Registry.java:931)
    at org.apache.commons.modeler.Registry.loadDescriptor s(Registry.java:909)
    at org.apache.commons.modeler.Registry.findDescriptor (Registry.java:992)
    at org.apache.commons.modeler.Registry.findManagedBea n(Registry.java:696)
    at org.apache.commons.modeler.Registry.findManagedBea n(Registry.java:1047)
    at org.apache.commons.modeler.Registry.registerCompon ent(Registry.java:859)
    at org.apache.catalina.loader.WebappLoader.init(Webap pLoader.java:573)
    at org.apache.catalina.loader.WebappLoader.start(Weba ppLoader.java:605)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:3985)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1011)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:718)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1011)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:440)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:450)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:683)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:537)
    ... 6 more

  8. #8
    KevinH's Avatar
    KevinH is offline Expert Member
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    What's in the $TOMCAT/webapps dir?
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  9. #9
    liyingchang is offline Intermediate Member
    Join Date
    Nov 2005
    Posts
    24
    Rep Power
    9

    Default

    total 14820
    drwxr-xr-x 5 zimbra zimbra 4096 Dec 21 10:46 balancer
    drwxr-xr-x 21 zimbra zimbra 4096 Dec 21 10:46 jsp-examples
    drwxr-xr-x 4 zimbra zimbra 4096 Dec 21 10:46 ROOT
    drwxrwxr-x 6 zimbra zimbra 4096 Dec 21 10:47 service
    -rw-r--r-- 1 zimbra zimbra 6838878 Dec 20 12:22 service.war
    drwxr-xr-x 4 zimbra zimbra 4096 Dec 21 10:46 servlets-examples
    drwxr-xr-x 12 zimbra zimbra 4096 Dec 21 10:46 tomcat-docs
    drwxr-xr-x 3 zimbra zimbra 4096 Dec 21 10:46 webdav
    drwxrwxr-x 13 zimbra zimbra 4096 Dec 21 10:46 zimbra
    drwxrwxrwx 14 root root 4096 Dec 21 10:49 zimbraAdmin
    -rw-r--r-- 1 zimbra zimbra 3809809 Dec 20 12:55 zimbraAdmin.war
    -rw-r--r-- 1 zimbra zimbra 4452789 Dec 20 12:56 zimbra.war


    Thanks !!!

  10. #10
    KevinH's Avatar
    KevinH is offline Expert Member
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    Try to start tomcat with just the Zimbra apps(service, zimbra, zimbraAdmin). You'll have to stop tomcat to move/delete those other webapps, but not having them there will also speed up your start time.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Installs but won't start on Linux FC6
    By iain in forum General Questions
    Replies: 6
    Last Post: 03-29-2007, 10:19 AM
  2. Replies: 0
    Last Post: 02-05-2007, 09:13 PM
  3. SSL Cert Problem using SOAP API
    By pbwebguy in forum Developers
    Replies: 1
    Last Post: 06-06-2006, 05:29 PM
  4. M3 problem with shares
    By titangears in forum Users
    Replies: 4
    Last Post: 01-12-2006, 01:01 PM
  5. Zimbra on Debian?
    By omry_y in forum Installation
    Replies: 25
    Last Post: 11-04-2005, 11:36 AM

Posting Permissions

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