Results 1 to 7 of 7

Thread: tomcat6 + eclipse not working

  1. #1

    Default 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:

    Code:
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
    	at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:54)
    Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    	... 1 more
    Then I googled a bit and found that fedora had somewhat similar problem: FedoraForum.org - Fedora 9: NoClassDefFoundError (LogFactory) starting Tomcat from Fedora Eclipse
    I tried their workaround by adding
    Code:
    Class-Path:  bootstrap.jar tomcat-juli.jar
    to bin/bootstrap.jar manifest but with no luck.

    Any ideas?

  2. #2

    Default Re: tomcat6 + eclipse not working

    Hmm I located the missing org.apache.commons.logging.LogFactory
    class
    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.

  3. #3

    Default Re: tomcat6 + eclipse not working

    Quote Originally Posted by meistrimees View Post
    Hmm I located the missing org.apache.commons.logging.LogFactory
    class
    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?

  4. #4

    Default Re: tomcat6 + eclipse not working

    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

  5. #5
    Join Date
    Apr 2009
    Location
    Stuttgart, Germany
    Posts
    113

    Default Re: tomcat6 + eclipse not working

    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.

  6. #6

    Default Re: tomcat6 + eclipse not working

    The above information is use full and resolved the problem

  7. #7
    Join Date
    Nov 2009
    Location
    Maryland, USA
    Posts
    43

    Default Re: tomcat6 + eclipse not working

    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!
    OpenSUSE 11.2 on Gateway desktop
    and Dell Inspiron laptop. Also use
    Mac PB G4 12"/OS X 10.5.8 (Leopard)
    because it's great to travel with.
    Linux user #: 501795

Posting Permissions

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