[eclipse] java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory

Seem to have a problem starting my Java app:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory at org.apache.catalina.util.LifecycleBase.(LifecycleBase.java:37) Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 1 more

Tried the solution here: java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory

But I see tomcat-juli.jar already. Also I'm using Tomcat 7. What might be wrong?

This question is related to eclipse tomcat

The answer is


This happened to me because I was using a Tomcat 5.5 catalina.sh file with a Tomcat 7 installation. Using the catalina.sh that came with the Tomcat 7 install fixed the problem.


  1. install tomcat

    # yum install tomcat6*

  2. edit tomcat conf file

    # vim /etc/tomcat6/tomcat-users.xml

something like:

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <role rolename="manager"/>
  <role rolename="admin"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
  <user username="TomcatAdmin" password="tomcat" roles="admin,manager"/>
</tomcat-users>
  1. create root directory for your J2EE project, example:

    $ mkdir -p ~/Project/java/

  2. do symbolic link, /usr/share/tomcat6/webapps/ to ~/Project/java/

    # ln -s /home//Project/java//dist/.war /usr/share/tomcat6/webapps/.war

Note: war archive file is created automatcaly when you use netbeans

0r you can do:

# ln -s /home/<login>/Project/java/<myProject>/webapps /usr/share/tomcat6/webapps/<myProject>
  1. check /etc/hosts file, this file must contain the machine name, mine hosts file

    jonathan 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

  2. start httpd service

    # service httpd start

  3. check loclahost web page

  4. start tomcat6

    # service tomcat6 start

  5. check localhost:8080 web page

  6. check that tomcat show your project
    if not:

    • check symbolic link and restart tomcat6 service
    • or add manualy with tomcat manager web page
      a) Set project name
      b) Se path to web.xml file
      c) Valid
      d) start your project (from web page)

for fedora 13 and under they are some problem, how fix it:

# chmod -R g+w /var/log/tomcat6 /etc/tomcat6/Catalina  
# chmod -R g+w /usr/share/tomcat6/work/  

check in log files located in /var/log/tomcat6/ if they are anymore "permission denied" message


On my PC I had to open the Tomcat6 entry again after the 7th step mentioned above and then change the default option under Server locations to Use tomcat installation.


I ran into this problem when using tomcat-embed-core::7.0.47, from Maven. I'm not sure why they didn't add tomcat-util as a runtime dependency, so I added my own runtime dependency to my own project.

<dependency>
  <groupId>org.apache.tomcat</groupId>
  <artifactId>tomcat-util</artifactId>
  <version><!-- version from tomcat-embed-core --></version>
  <scope>runtime</scope>
</dependency>

On Ubuntu 14.04 LTS

/usr/share# mv /opt/tomcat/apache-tomcat-7.0.56/ tomcat7

fixed the issue for me. There was a symbolic link there to /opt. Inside that opt directory there where ../../java links that would not point to /usr/share/java since the files physically were in /opt


I copied the contents of the "C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf" directory to the "workspace\Servers\Tomcat v6.0 Server at localhost-config" directory for Eclipse. I refreshed the "Servers\Tomcat v6.0 Server at localhost-config" folder in the Eclipse Project Explorer and then everything was good.


I found the solution here: http://forums.opensuse.org/applications/391114-tomcat6-eclipse-not-working.html

  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.

Hopefully posting it here will help some poor soul.


I had the same problem, What helped me was:

  1. Right click on the project.
  2. Click 'Properties'
  3. Go to 'Java Build Path'
  4. And then: 'Libraries'
  5. In there, Click: Add External Jars
  6. Add: ''Path/To/Tomcat/Bin/tomcat-juli.jar

Done .


aforementioned solutions did not help me, I could solve it by re-installing the Tomcat server which took few seconds.


If you are using jsvc to run tomcat as tomcat (run /etc/init.d/tomcat as root), edit /etc/init.d/tomcat and add $CATALINA_HOME/bin/tomcat-juli.jar to CLASSPATH.


In our case, the wrong version of the Sysdeo Tomcat plugin for Eclipse 3.5 was being used. The fix:

  • Use tomcatPluginV33 instead of tomcatPluginV321 (extract to C:\eclipse\dropins)
  • Ensure that DevloaderTomcat7.jar was placed in the tomcat lib folder
  • In Window > Preferences > Tomcat, set the Tomcat version to 7.x

This problem may have been unique to our environment; but, I'll record it here anyway, for posterity's sake.


Examples related to eclipse

How do I get the command-line for an Eclipse run configuration? My eclipse won't open, i download the bundle pack it keeps saying error log strange error in my Animation Drawable How to uninstall Eclipse? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Class has been compiled by a more recent version of the Java Environment Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory How to downgrade Java from 9 to 8 on a MACOS. Eclipse is not running with Java 9 "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat

Examples related to tomcat

Jersey stopped working with InjectionManagerFactory not found The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat Spring boot: Unable to start embedded Tomcat servlet container Tomcat 404 error: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists Spring Boot application in eclipse, the Tomcat connector configured to listen on port XXXX failed to start Kill tomcat service running on any port, Windows Tomcat 8 is not able to handle get request with '|' in query parameters? 8080 port already taken issue when trying to redeploy project from Spring Tool Suite IDE 403 Access Denied on Tomcat 8 Manager App without prompting for user/password Difference between Xms and Xmx and XX:MaxPermSize