严重:异常启动过滤器sessionfilter

时间:2015-11-16 02:16:21

标签: java classnotfoundexception

我有一个java web项目的问题:我认为它与配置文件有关但当前我没有解决方案来解决它。 所以希望任何人都可以帮助我。

INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [111] milliseconds.
log4j:WARN No appenders could be found for logger (org.seasar.extension.filter.RequestDumpFilter).
log4j:WARN Please initialize the log4j system properly.
thg 11 16, 2015 8:50:19 SA org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter sessionfilter
java.lang.ClassNotFoundException: jp.co.colotown.seasar2.filter.SessionFilter
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:520)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:501)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:120)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4583)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

thg 11 16, 2015 8:50:19 SA org.apache.catalina.core.StandardContext startInternal
SEVERE: One or more Filters failed to start. Full details will be found in the appropriate container log file
thg 11 16, 2015 8:50:19 SA org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/Colotown] startup failed due to previous errors

代码web.xml

<?xml version="1.0"?>

<!--
 * Copyright 2004-2006 the Seasar Foundation and the Others.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
-->

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">

    <context-param>
        <param-name>sastruts.VIEW_PREFIX</param-name>
        <param-value>/WEB-INF/view</param-value>
    </context-param>

     <filter>
        <filter-name>sessionfilter</filter-name>
         <filter-class>jp.co.colotown.seasar2.filter.SessionFilter</filter-class>
    </filter>

    <filter>
        <filter-name>encodingfilter</filter-name>
        <filter-class>org.seasar.extension.filter.EncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
    </filter>

    <filter>
        <filter-name>hotdeployfilter</filter-name>
        <filter-class>org.seasar.framework.container.hotdeploy.HotdeployFilter</filter-class>
    </filter>

    <filter>
        <filter-name>s2filter</filter-name>
        <filter-class>org.seasar.framework.container.filter.S2ContainerFilter</filter-class>
    </filter>

    <filter>
        <filter-name>routingfilter</filter-name>
        <filter-class>org.seasar.struts.filter.RoutingFilter</filter-class>
        <init-param>
            <param-name>jspDirectAccess</param-name>
            <param-value>false</param-value>
        </init-param>
    </filter>

    <filter>
        <filter-name>requestDumpFilter</filter-name>
        <filter-class>org.seasar.extension.filter.RequestDumpFilter</filter-class>
    </filter>


<!--
    <filter-mapping>
        <filter-name>sessionfilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
-->


    <filter-mapping>
        <filter-name>encodingfilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>


    <filter-mapping>
        <filter-name>hotdeployfilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>

    <filter-mapping>
        <filter-name>s2filter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>

    <filter-mapping>
        <filter-name>routingfilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
    </filter-mapping>

    <filter-mapping>
        <filter-name>requestDumpFilter</filter-name>
        <url-pattern>*.do</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>

    <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
            <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <init-param>
            <param-name>configFactory</param-name>
            <param-value>org.seasar.struts.config.S2ModuleConfigFactory</param-value>
        </init-param>
        <init-param>
            <param-name>debug</param-name>
            <param-value>2</param-value>
        </init-param>
        <init-param>
            <param-name>detail</param-name>
            <param-value>2</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
        <servlet-name>s2container</servlet-name>
        <servlet-class>org.seasar.framework.container.servlet.S2ContainerServlet</servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>s2container</servlet-name>
        <url-pattern>/s2container/*</url-pattern>
    </servlet-mapping>


    <error-page>
        <error-code>500</error-code>
        <location>/login.do</location>
    </error-page>


    <session-config>
        <session-timeout>180</session-timeout>
    </session-config>


    <!--
    <welcome-file-list>
    </welcome-file-list>
    -->

    <jsp-config>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <el-ignored>false</el-ignored>
            <page-encoding>UTF-8</page-encoding>
            <scripting-invalid>false</scripting-invalid>
            <include-prelude>/WEB-INF/view/common/common.jsp</include-prelude>
        </jsp-property-group>
    </jsp-config>
</web-app>

1 个答案:

答案 0 :(得分:0)

jp.co.colotown.seasar2.filter.SessionFilter未包含在您的war文件中。

它必须位于以下两个位置之一:

    .war文件中的
  1. WEB-INF/classes/jp/co/colotown/seasar2/filter/SessionFilter.class
  2. jp/co/colotown/seasar2/filter/SessionFilter.class位于.war文件的WEB-INF/lib中的.jar文件中。
  3. 由于.war文件和.jar文件实际上都是.zip文件,因此您可以使用您选择的程序打开它们,例如: WinZip,用于验证内容。