标题:CloseSessionFilter和SetCharacterEncodingFilter异常
只看楼主
tianbian210
Rank: 1
等 级:新手上路
帖 子:46
专家分:1
注 册:2008-12-25
结帖率:87.5%
 问题点数:0 回复次数:2 
CloseSessionFilter和SetCharacterEncodingFilter异常
程序代码:
tomcat抛出一下异常,请求帮助:

2011-04-27 15:37:39 StandardContext[/NEWS]Exception starting filter CloseSessionFilter
java.lang.ClassNotFoundException:  at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:211)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:308)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:79)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3698)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4349)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
    at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
    at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
    at org.apache.catalina.core.StandardService.start(StandardService.java:480)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

2011-04-27 15:37:39 StandardContext[/NEWS]Exception starting filter SetCharsetEncodingFilter
java.lang.ClassNotFoundException:  at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:211)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:308)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:79)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3698)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4349)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
    at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
    at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
    at org.apache.catalina.core.StandardService.start(StandardService.java:480)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

2011-04-27 15:37:39 StandardContext[/servlets-examples]ContextListener: contextInitialized()
2011-04-27 15:37:39 StandardContext[/servlets-examples]SessionListener: contextInitialized()


搜索更多相关主题的帖子: starting filter 
2011-04-27 15:40
tianbian210
Rank: 1
等 级:新手上路
帖 子:46
专家分:1
注 册:2008-12-25
得分:0 
修改了web.xml中的
程序代码:
 <filter>
        <filter-name>SetCharsetEncodingFilter</filter-name>
        <filter-class>com.bbs.util.SetCharacterEncodingFilter</filter-class>
       

        <!--

        <filter-class>class>
         -->
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
    </filter>
   

    <filter>
        <filter-name>CloseSessionFilter</filter-name>
        <filter-class>com.bbs.util.CloseSessionFilter</filter-class>
        <!-- 

        <filter-class>class>
        -->
    </filter>

tomcat不报错了。
2011-04-27 20:22
tianbian210
Rank: 1
等 级:新手上路
帖 子:46
专家分:1
注 册:2008-12-25
得分:0 
可是运行程序的时候抛出
程序代码:
exception


javax.servlet.ServletException: com.bbs.web.struts.action.SubjectAction.editbyadmin(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
    org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)
    org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
    org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    com.bbs.util.CloseSessionFilter.doFilter(CloseSessionFilter.java:37)
    com.bbs.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:91)


root cause

异常。closeSessionFilter.java 37行
try{
            chain.doFilter((HttpServletRequest)request, (HttpServletResponse)response);
        }

2011-04-27 20:24



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-338118-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.320879 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved