2 wangcheng555666 wangcheng555666 于 2016.03.30 17:57 提问

这个怎么解决啊 ???

java.lang.ClassCastException: com.bookonline.Filter.SetCharacterEncoding cannot be cast to javax.servlet.Filter
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4071)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4725)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1383)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:306)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1385)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1649)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1658)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1638)
at java.lang.Thread.run(Thread.java:619)
2016-3-30 17:52:18 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2016-3-30 17:52:18 org.apache.catalina.core.StandardContext start
严重: Context [/bookonline] startup failed due to previous errors

5个回答

Royal_lr
Royal_lr   Ds   Rxr 2016.03.30 18:00

类型转换异常,,你把SetCharacterEncoding 这个转成Filter,,

wangcheng555666
wangcheng555666 不会转啊
一年多之前 回复
sl_18500
sl_18500   2016.03.30 18:11

com.bookonline.Filter.SetCharacterEncoding cannot be cast to javax.servlet.Filter转换错误

wangcheng555666
wangcheng555666 可是我不会改啊
一年多之前 回复
CSDNXIAON
CSDNXIAON   2016.03.30 18:32

Eclipse 重装Android ADT 问题~解决方案-转
----------------------同志你好,我是CSDN问答机器人小N,奉组织之命为你提供参考答案,编程尚未成功,同志仍需努力!

wojiushiwo945you
wojiushiwo945you   Ds   Rxr 2016.03.30 18:37

检查下你的web.xml中配置的拦截器类,替换成正确的类型试试。

wangcheng555666
wangcheng555666 好像没有错
一年多之前 回复
daidaineteasy
daidaineteasy   Ds   Rxr 2016.03.30 18:51

SetCharacterEncoding 在这个类中实现一下 Filter接口

    public class SetCharacterEncoding implements Filter{
        ....
        ....
        ....
    }
wangcheng555666
wangcheng555666 实现了,这个没问题
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!