简体   繁体   中英

Java Servlet exception

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM