I installed tomcat a few weeks ago and everything was fine, I had it running for a while. Then one day I start the deamon and it shuts down right away. I checked the logs and there was a stack dump. I thought it was related to java-config so I set sun-jdk as the default vm instead but that didn't help. Since then I've tried a lot of things read in the forums, with older versions, newer versions etc. I ran out of ideas on how to get it working so I unmerged all java related packages and reemerged tomcat with its dependencies. And that changed nothing, /var/log/tomcat/catalina.log says: /opt/tomcat/bin/catalina.sh: line 188: : command not found Starting from that line, this is what it contains: "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \ -Dcatalina.base="$CATALINA_BASE" \ -Dcatalina.home="$CATALINA_HOME" \ -Djava.io.tmpdir="$CATALINA_TMPDIR" \ org.apache.catalina.startup.Bootstrap "$@" start \ >> "$CATALINA_OUT" 2>&1 & So I'm stuck. If I try to start the server executing /opt/tomcat/bin/startup-using-launcher.sh I get this: java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/AntMain at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:502) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:250) at java.net.URLClassLoader.access$100(URLClassLoader.java:54) at java.net.URLClassLoader$1.run(URLClassLoader.java:193) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:186) at java.lang.ClassLoader.loadClass(ClassLoader.java:299) at java.lang.ClassLoader.loadClass(ClassLoader.java:255) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315) at org.apache.commons.launcher.Launcher.start(Launcher.java:385) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at LauncherBootstrap.main(LauncherBootstrap.java:185) So it it related to Ant then? It's not listed as a dependency and I had it installed before while this exact same problem was being felt. Reproducible: Always Steps to Reproduce: 1. emerge tomcat w/ dependencies 2. 3. Actual Results: Deamon starts but crashes immediately afterwards. ps lists no tomcat related processes. Expected Results: Start the deamon correctly. # emerge info Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.6.5-rc3-love1) ================================================================= System uname: 2.6.5-rc3-love1 i686 Intel(R) Pentium(R) 4 CPU 2.00GHz Gentoo Base System version 1.4.3.13 distcc 2.12.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] Autoconf: sys-devel/autoconf-2.58-r1 Automake: sys-devel/automake-1.7.7 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=pentium4 -O2 -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /etc/tomcat /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -mcpu=i686 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache distcc sandbox" GENTOO_MIRRORS="ftp://trumpetti.atm.tut.fi/gentoo/ http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://sunsite.dk/mirrors/gentoo http://www.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/overlay" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="3dnow X aalib alsa apm avi berkdb bonobo cdr crypt encode esd foomaticdb gdbm gif gnome gphoto2 gpm gtk gtk2 imlib java jpeg kde ldap libg++ libwww mad mikmod mmx motif mozilla moznocompose moznoirc moznomail mpeg ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline samba sdl slang spell ssl svga tcltk tcpd tetex truetype x86 xml2 xmms xv zlib"
package versions: net-www/tomcat-5.0.18 dev-java/blackdown-jdk-1.4.1 dev-java/java-config-1.2.6
Don't know if my problems with tomcat are related to this bug, but I have a very similar error. Tomcat used to work OK, but know it won't start, and catalina.log says: xception during startup processing java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) Caused by: java.lang.NoClassDefFoundError: javax/management/MBeanException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at org.apache.catalina.util.xml.ObjectCreate.start(XmlMapper.java:616) at org.apache.catalina.util.xml.XmlMapper.matchStart(XmlMapper.java:412) at org.apache.catalina.util.xml.XmlMapper.startElement(XmlMapper.java:91) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:228) at org.apache.catalina.startup.Catalina.start(Catalina.java:725) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) ... 5 more As you can see, it's not the same exception, but similar, as if some package is missing (I've checked my tomcat lib tree agains the Tomcat FAQ and seems to be okay). Any tips? Thx.
Well I got tomcat working finally. I was trying the various ebuilds again, those posted in the bugs section and I thought I would try and install it manually for my own needs. It turns out that it's very simple. Unpack the archive is all I had to do. Didn't even touch the config files, of course now it's all in /opt/tomcat, including conf files and all. Just run bin/startup.sh and it does start, magically. I wonder then why it's so hard to make a working ebuild, I also tried installing the package (5.0.18) on a completely new server and it also failed there. I don't have a clue about python, otherwise I would try and hack the ebuild to get it working.
One interesting note, tomcat starts perfectly before merging sun-j2ee package. But of course, without it you cannot compile servlets and other tomcat related things :)
Tomcat 5.0.27 is out, and the latest unmasked ebuild is 5.0.18, is there a new version comeing out soon? And this bug was filed 2004-04-01, almost 3 months ago, any fixes or tips out yet?
newer tomcat ebuild & versions are in the tree now, this is an old report for an old version If are still having problems with the never ones please reopen the bug and ill look into it