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)
原因:可能是包冲突了 One of your dependencies are including a servlet-api into your war file which causes that behavior. Using mvn dependency:tree, you can find out which of your dependency is that. After that you need to exclude the servlet-api as follows:
<dependency> 解决办法:
<dependency>
<groupId>[VALUE]</groupId>
<artifactId>[VALUE]</artifactId>
<version>[VALUE]</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
例子:
<!-- 去除自带servlet依赖避免冲突-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>

cannot be cast to javax.servletFilter的更多相关文章

  1. Java-maven异常-cannot be cast to javax.servlet.Filter 报错, 原因servlet-api.jar冲突

    使用maven开发web应用程序, 启动的时候报错: jar not loaded. See Servlet Spec . Offending class: javax/servlet/Servlet ...

  2. org.apache.cxf.transport.servlet.CXFServlet cannot be cast to javax.servlet.Servlet

    java.lang.ClassCastException: org.apache.cxf.transport.servlet.CXFServlet cannot be cast to javax.se ...

  3. java.lang.ClassCastException: org.springframework.web.filter.CharacterEncodingFilter cannot be cast to javax.servlet.Filter

    java.lang.ClassCastException: org.springframework.web.filter.CharacterEncodingFilter cannot be cast ...

  4. cannot be cast to javax.servlet.Servlet

    在第一次开发Maven项目时,maven环境和仓库以及eclipse都和讲师讲解的一样,可是却遇到下面这个问题: java.lang.ClassCastException: servlet.UserS ...

  5. WebLogic部署报java.lang.ClassCastException: weblogic.xml.jaxp.RegistrySAXParserFactory cannot be cast to javax.xml.parsers.SAXParserFactory

    今天在部署WebLogic项目时,报了java.lang.ClassCastException: weblogic.xml.jaxp.RegistrySAXParserFactory cannot b ...

  6. Caused by: java.lang.ClassCastException: org.springframework.web.SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer错误解决办法

    严重: Failed to initialize end point associated with ProtocolHandler ["http-bio-8080"] java. ...

  7. Caused by: java.lang.ClassCastException: org.springframework.web.SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer

    A child container failed during startjava.util.concurrent.ExecutionException: org.apache.catalina.Li ...

  8. java.lang.ClassCastException:weblogic.xml.jaxp.RegistryDocumentBuilderFactory cannot be cast to javax.xml.parsers.DocumentBuilderFactory

    java.lang.ClassCastException:weblogic.xml.jaxp.RegistryDocumentBuilderFactory cannot be cast to java ...

  9. java.lang.ClassCastException: cn.itcase.serviceImpl.servicestudentImpl cannot be cast to javax.servlet.Servlet

    java.lang.ClassCastException: cn.itcase.serviceImpl.servicestudentImpl cannot be cast to javax.servl ...

随机推荐

  1. Task WaitAll的用法

    var tasklst = new List<Task>(); ; i < urls.Count; i++) { tasklst.Add(Task.Factory.StartNew& ...

  2. ajax跨域--jsop方法

    1.什么是JSONP? 要了解JSONP,不得不提一下JSON,那么什么是json ? json简单说就是javascript中的对象和数组,所以这两种结构就是对象和数组两种结构,通过这两种结构可以表 ...

  3. Navicat Premium 快捷键

    1.ctrl+q 打开查询窗口2.ctrl+/ 注释sql语句3.ctrl+shift +/ 解除注释4.ctrl+r 运行查询窗口的sql语句5.ctrl+shift+r 只运行选中的sql语句6. ...

  4. unity 已知cosA和sinA,求A

    和c++中的atan2(y,x)类似,unity中有也Mathf.Atan2(y,x).

  5. atitit.php 流行框架 前三甲为:Laravel、Phalcon、Symfony2 attilax 总结

    atitit.php 流行框架 前三甲为:Laravel.Phalcon.Symfony2 attilax 总结 1. ,最流行的PHP框架前三甲为:Laravel.Phalcon.Symfony2. ...

  6. atitit.无为而治在企业管理,国家治理,教育领域的具体思想与实践

    atitit.无为而治在企业管理,国家治理,教育领域的具体思想与实践 1. 什么是无为而治 1 2. 无为而治的三个原则 1 3. 抓大放小 1 4. 治理国家 2 5. 企业管理 2 6. 教育领域 ...

  7. (2.1)Smali系列学习之基础语法

    一.什么是Smali?Smali,Baksmali分别是指安卓系统里的Java虚拟机(Dalvik)所使用的一种dex格式文件的汇编器,反汇编器.其语法是一种宽松式的Jasmin/dedexer语法, ...

  8. List 通过 Collections.binarySearch 进行记录筛选

    1. Collections.sort(list, new Comparator<TreeDto>() { @Override public int compare(TreeDto a2, ...

  9. mybatis3 sqlsession

    1.mybatis3中的通过openSession()方法打开的sqlsession,它的事务默认是关闭的,所以进行数据库完成操作之后,要记得commit(),也可以添加openSession(boo ...

  10. 浅谈myeclipse2015做cordova/phonegap开发

    近期公司项目经理要求用cordova写安卓程序,之前对cordova什么都不懂,然后从网上搜啊搜,好歹有所了解了,感觉做web开发的比較合适,属于三种开发模式的第三种. myeclipse2015有个 ...