NoClassDefFoundError in web application running on Tomcat 7

前端 未结 4 432
面向向阳花
面向向阳花 2021-01-02 12:46

I have web application written in Java using gucie-servlet framework being built by Maven 3. When I deploy it on Tomcat 7 container and try to access it using browser, Tomca

4条回答
  •  轮回少年
    2021-01-02 13:08

    OK, I've found the solution. After careful study of my /logs/catalina.log I've found this record:

    Apr 5, 2013 1:38:26 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(/home/frodo/apache-tomcat-7.0.37/webapps/hive/WEB-INF/lib/base-0.0.42-SNAPSHOT.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    

    This question explains the reason of this message - my JAR base-0.0.42-SNAPSHOT.jar contains something related to Servlet API and can't be loaded by Tomcat because of it. So, my web app can't find classes in this JAR after start. I'm using some parts of Twitter commons inside this JAR which contain realization of Servlet API. After revision of the dependencies of base-0.0.42-SNAPSHOT.jar my app starts and loads classes needed. Thank you to everyone!

提交回复
热议问题