springmvc常遇到的错误

错误1:

  HTTP Status 500 - Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

NoClassDefFoundError指明没有该类的定义,就是缺少某个jar包导致的,去下载standard和jstl两个包然户放入lib下就好了。

错误2:

  把springmvc发布到tomcat里,tomcat启动发生错误,很好可能就是缺少基本的相关jar包了,比如:

A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/01springmvc-hello]]

这时缺少spring-web-4.0.0.RELEASE.jar所导致的。

问题3:

  当修改action类或者controller类中内容时,但是运行发现还是未修改之前的处理方法,这个时候clean一下也许就会解决问题。选择project->clean,选择你要clean的项目。

问题4

Description Resource Path Location Type
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path index.jsp /maven1/src/main/webapp line 1 JSP Problem

右键项目名build path->configure build path->libraries->add library->server runtime->tomcat

问题5

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

这是缺少mysql-connector-java-x.x.x-bin.jar所至少,在lib加上该jar包,然后build path->add to build...。有时候弄完该步骤后还提示缺少com.mysql.jdbc.Driver,这就需要把mysql-connector-java-x.x.x-bin.jar拷贝放到tomcat的lib目录下就好了

原文地址:https://www.cnblogs.com/Hxinguan/p/5967231.html