maven struts2工程StrutsPrepareAndExecuteFilter cannot be cast to javax.servlet.Filter

maven搭建struts2工程时报错

严重: Exception starting filter struts2
java.lang.ClassCastException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter cannot be cast to javax.servlet.Filter

工程是复制的,所以从pom.xml导入时一些jar包引用清理的不干净,最后找到原因是与servlet-api有冲突,pom.xml里把servlet-api的引入删除即可

时间: 2024-10-07 03:56:34

maven struts2工程StrutsPrepareAndExecuteFilter cannot be cast to javax.servlet.Filter的相关文章

在maven项目中使用apache cxf中遇到异常 java.lang.ClassCastException: org.springframework.web.filter.CharacterEncodingFilter cannot be cast to javax.servlet.Filter

使用maven虽然很方便,写一个dependency的标签就可以直接从仓库下载对应的jar包,还能处理该jar包的继承依赖关系.但是同时需要你对jar包更加了解,如果依赖关系很复杂,那么很可能会产生jar包冲突,从而使项目报一些莫名其妙的异常. 在用apache cxf的过程中就出现了这样的问题. 1,在项目的pom.xml中加入apache cxf的依赖配置: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xs

can not be cast to javax.servlet.Filter等问题的解决方法

问题1:can not be cast to javax.servlet.Filter 一位从测试转开发的同事首次更新代码,并编译在本地启动web项目时,报如下错误: Exception starting filter encodingFilterjava.lang.ClassCastException:com.gaochao.platform.web.context.filter.ContextFilter2 can not be cast to javax.servlet.Filter 根据

cannot be cast to javax.servlet.Filter 报错, 原因servlet-api.jar冲突

使用maven开发web应用程序, 启动的时候报错: jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 然后输出错误: 严重: Exception starting filter encodingFilter java.lang.ClassCastException: org.springframework.web.filter.CharacterEn

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

使用maven开发web应用程序, 启动的时候报错: jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 然后输出错误: 严重: Exception starting filter encodingFilter java.lang.ClassCastException: org.springframework.web.filter.CharacterEn

maven构建web项目,cannot be cast to javax.servlet.Servlet

调试Spring MVC时发现如下异常: java.lang.ClassCastException: org.springframework.web.servlet.DispatcherServlet cannot be cast to javax.servlet.Servlet 问题出在servlet-api.jar上,tomcat部署springMVC项目时是不用这个包的,而用maven构建项目时需要,如果不引用该依赖就会不识别  HttpServletRequest等的类 解决方法是在ma

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.net.BindException: Address already in use <null>:8080 at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:407) at org.apache.tomcat.util.

org.apache.struts.taglib.bean.CookieTei cannot be cast to javax.servlet.jsp.tagext.TagExtraInfo

严重: Servlet.service() for servlet jsp threw exceptionjava.lang.ClassCastException: org.apache.struts.taglib.bean.CookieTei cannot be cast to javax.servlet.jsp.tagext.TagExtraInfo at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibra

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.servlet.Servlet maven下web项目依赖servlet-api.jar 1 <dependency> 2 <groupId>javax.servlet</groupId> 3 <artifactId>servlet-api</artifact

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.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/book_shop]] at java.util.concurrent.Futur