Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-20-2005, 06:13 PM
Intermediate Member
 
Posts: 24
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.
Reply With Quote
  #2 (permalink)  
Old 12-20-2005, 06:41 PM
Zimbra Employee
 
Posts: 4,792
Default

Well you could run tomcat in eclipse(ie start it running under the debugger).
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #3 (permalink)  
Old 12-20-2005, 07:12 PM
Intermediate Member
 
Posts: 24
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)
Reply With Quote
  #4 (permalink)  
Old 12-20-2005, 07:35 PM
Zimbra Employee
 
Posts: 274
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.
Reply With Quote
  #5 (permalink)  
Old 12-21-2005, 11:34 AM
Intermediate Member
 
Posts: 24
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 ?
Reply With Quote
  #6 (permalink)  
Old 12-21-2005, 11:53 AM
Zimbra Employee
 
Posts: 93
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.
Reply With Quote
  #7 (permalink)  
Old 12-21-2005, 01:00 PM
Intermediate Member
 
Posts: 24
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
Reply With Quote
  #8 (permalink)  
Old 12-21-2005, 01:09 PM
Zimbra Employee
 
Posts: 4,792
Default

What's in the $TOMCAT/webapps dir?
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #9 (permalink)  
Old 12-21-2005, 02:02 PM
Intermediate Member
 
Posts: 24
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 !!!
Reply With Quote
  #10 (permalink)  
Old 12-21-2005, 02:08 PM
Zimbra Employee
 
Posts: 4,792
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.
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.