错误 ::
java.lang.ClassCastException: org.springframework.web.filter.CharacterEncodingFilter cannot be cast to javax.servlet.Filter
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope> <添加这个 范围-->
</dependency>
onfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.
java:4001)
at
作者:css零基础入门学习
链接:http://www.imooc.com/article/79415
来源:慕课网
onfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.
java:4001)
at
作者:css零基础入门学习
链接:http://www.imooc.com/article/79415
来源:慕课网
onfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.
java:4001)
at
作者:css零基础入门学习
链接:http://www.imooc.com/article/79415
来源:慕课网哎哎
因为tomcat也有servlet的jar包,所以把pom.xml的servlet-api的jar范围改为provided。
<!-- servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
作者:css零基础入门学习
链接:http://www.imooc.com/article/79415
来源:慕课网
原文地址:https://www.cnblogs.com/qinning/p/9833855.html