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>