Tomcat报错:java.lang.ClassCastException: ***cannot be cast to javax.servlet.Filter解决办法
今天在学习Java Web过滤器遇到如下报错:
九月 26, 2019 10:54:07 下午 org.apache.catalina.core.StandardContext filterStart
严重: 启动过滤器异常
java.lang.ClassCastException: org.mvc.LoginServlet cannot be cast to javax.servlet.Filter
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:249)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:102)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4533)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5172)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(Co