0

I try to start the server using servlet but I get a java exception

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
    at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:60)

It says that the {60 is not a valid line number in org.apache.catalina.startup.Bootstrap}

in bootstrap.class in a class file editor, it shows that: the source attachment does not contain the source for the file Bootstrap.class. can I get any help, please?

2
  • It says exactly that. No class definition found for LogFactory. It can't find the LogFactory class in your classpath. You are missing a jar file for LogFactory. Once you have that jar file put it in your classpath. Commented Apr 27, 2020 at 14:54
  • java2s.com/Code/JarDownload/tomcat-/… I added the jar in this link to the lib dir, but it didn't work also. Commented Apr 27, 2020 at 17:39

1 Answer 1

0

This looks like a duplicate, take a look at this answer for additional help. Basically you need need to check that you have the tomcat-juli.jar file on the classpath. If you don't see it in the Tomcat lib dir, you can add it.

For maven add it as a runtime dependency:

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

re: https://stackoverflow.com/a/7955567/5318686

Sign up to request clarification or add additional context in comments.

4 Comments

tomcat-juli.jar is exists in bin dir, I make another copy to lib dir but it didn't work
Are you running Tomcat in Eclipse or some other IDE? Reason why I ask is to make sure you are putting the jar in the correct lib dir. Double-check the lib directory is correct.
yes, I use Eclipse. The lib dir that I mean is the lib in the dir in Tomcat dir.
You could try to see if the lib dir being used by Eclipse to startup Tomcat is the same. Go to the run configurations you are using to startup the server, in there you will see the directory Eclipse will use for starting up Tomcat. I can't remember but I think it is configurable to set the lib dir, my guess is that it isn't getting deployed properly. Try looking at your runtime settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.