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</artifactId>
4     <version>2.4</version>
5 </dependency>

忘了应该这么写以免与tomcat内置jar包冲突:

1 <dependency>
2    <groupId>javax.servlet</groupId>
3    <artifactId>servlet-api</artifactId>
4    <version>2.4</version>
5    <scope>provided</scope>
6 </dependency>

 

posted @ 2015-04-30 17:28  xiluhua  阅读(2334)  评论(0编辑  收藏  举报