I apologize. I already cross posted this message on FedoraForum.org but didn't generate any responses. And then I found THIS list. If this list isn't the appropriate one for this question then please slap me down. I'll take my licks. ;-)
I feel silly asking this question. I'm not totally a Tomcat/Eclipse/Java noob...but I feel like one asking this question. And Google's even my BFF...but I can't figure this one out...yet.
I have a brand new clean installation of Fedora 9. I let the installer automagically install Fedora Eclipse, Tomcat and Java for me. I'm fully patched (yum update). Then I installed the Sysdeo Tomcat plugin. From the plugin I pointed to Tomcat base: /usr/share/tomcat5
When I launch Tomcat from Fedora Eclipse, I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:54) Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.j ava:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:3 23) at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:2 68) at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:336) ... 1 more
Here is the output from the instructions listed on this page: http://fedoraproject.org/wiki/DebuggingEclipseProblems
# for f in `rpm -aq | egrep "eclipse|swt"`; do rpm -qV $f; done # which java /usr/bin/java # readlink -f `which java` /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/bin/java # which javac /usr/bin/javac # readlink -f `which javac` /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/bin/javac # java -version java version "1.6.0" OpenJDK Runtime Environment (build 1.6.0-b09) OpenJDK Client VM (build 1.6.0-b09, mixed mode)
Now here's where it got really interesting. Since it was complaining about LogFactory, I located it inside /usr/share/tomcat5/bin/commons-logging-api.jar
So, just for grins, I unjar'ed the contents of: /usr/share/tomcat5/bin/bootstrap.jar and /usr/share/tomcat5/bin/commons-logging-api.jar Then I jar'ed all of the contents of those two jar files back into: /usr/share/tomcat5/bin/bootstrap.jar
And now I can launch Tomcat from Fedora Eclipse just fine. This is obviously a classpath issue....but whose? Is this a Fedora configuration problem? I don't even know how to proceed from here to clean up this mess. I'd really like to not launch Tomcat using jar files that I've hacked together...just to get it to run.
Oh, by the way, I also installed tomcat6 and had the same problem...except I now located the missing LogFactory class in tomcat-juli.jar
Hi,
* Greg Johnson gregjo@yahoo.com [2008-05-22 16:33]:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
[...]
Now here's where it got really interesting. Since it was complaining about LogFactory, I located it inside /usr/share/tomcat5/bin/commons-logging-api.jar
So, just for grins, I unjar'ed the contents of: /usr/share/tomcat5/bin/bootstrap.jar and /usr/share/tomcat5/bin/commons-logging-api.jar Then I jar'ed all of the contents of those two jar files back into: /usr/share/tomcat5/bin/bootstrap.jar
And now I can launch Tomcat from Fedora Eclipse just fine. This is obviously a classpath issue....but whose?
This sounds like something is different with the packaging of the tomcat jars and how the Sysdeo plugin expects them to be. You should file a bug against the tomcat package to track this, but you could also email the JPackage project since the tomcat RPMs in Fedora come from there (AFAIK). In fact, I recall reading something on jpackage-discuss about tomcat jar contents a few months ago ... perhaps this is related.
HTH,
Andrew
java-devel@lists.fedoraproject.org