tomcat6 + eclipse not working

I installed tomcat6 from the official opensuse11 repository(v 6.0.16-5.1) and updated from the official update repository to version 6.0.16-6.2
It works with normal “/etc/init.d/tomcat 6 start” but when i tried configure with eclipse got following errors:

Firstly eclipse could not create new tomcat6 server because
lib/servlet-api.jar didnt exist, instead it had lib/tomcat6-servlet-2.5-api-6.0.16.jar
I just copied servlet-2.5-api-6.0.16.jar to servlet-api.jar and got this solved.

Secondly when starting the server from eclipse i got the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
	at org.apache.catalina.startup.Bootstrap.<clinit>(
Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
	at Method)
	at java.lang.ClassLoader.loadClass(
	at sun.misc.Launcher$AppClassLoader.loadClass(
	at java.lang.ClassLoader.loadClass(
	at java.lang.ClassLoader.loadClassInternal(
	... 1 more

Then I googled a bit and found that fedora had somewhat similar problem: - Fedora 9: NoClassDefFoundError (LogFactory) starting Tomcat from Fedora Eclipse
I tried their workaround by adding

Class-Path:  bootstrap.jar tomcat-juli.jar

to bin/bootstrap.jar manifest but with no luck.

Any ideas?

Hmm I located the missing org.apache.commons.logging.LogFactory
Its located in bin/tomcat-juli.jar in org.apache.juli.logging.LogFactory

So the problem is there, but i cannot understand is it a opensuse tomcat6 package problem or eclipse’s.
Anyways it seams like a bug.

Nevermind that. I made a little typo:
In tomcat5 LogFactory class is located in org.apache.commons.logging.LogFactory
tomcat6 has it in org.apache.juli.logging.LogFactory

So the question remains: why it cannot find LogFactory?

Any luck getting this to work yet? I am trying as well and running into issues. Please let me know if you figured out how to get eclipse to work with Tomcat

I guess it might be a packaging issue.

To work it around, you need to add the tomcat-juli.jar to the run configuration class path.

Here are the steps how to do it:

  1. In Eclipse, Open the “Server” tab.
  2. Double click on the “Tomcat6” entry to see the configuration.
  3. Then click on the “Open launch configuration” link in the “General information” block.
  4. In the dialog, select the “Classpath” tab.
  5. Click the “Add external jar” button.
  6. Select the file “/usr/share/tomcat6/bin/tomcat-juli.jar”
  7. Close the dialog.
  8. Start tomcat 6 from Eclipse.

The above information is use full and resolved the problem

Brilliant! I’ve been trying to solve this problem off and on for 2 weeks, and I was beginning to think it was hopeless.

Thank you very much for taking the time to provide this solution - almost exactly 2 years ago.

Be well!