应用ESAPIWebApplicationFirewallFilter时ClassNotFoundException:org.owasp.esapi.waf.ESAPIWebApplicationFirewallFilter

时间:2021-05-29 05:01:16

Web.xml

<filter>
    <filter-name>ESAPI-WAF</filter-name>
    <filter-class>org.owasp.esapi.waf.ESAPIWebApplicationFirewallFilter</filter-class>
    <init-param>
        <param-name>log_settings</param-name>
        <param-value>/WEB-INF/log4j-waf.xml</param-value>
    </init-param>
    <init-param>
        <param-name>configuration</param-name>
        <param-value>/WEB-INF/waf-policy.xml</param-value>
    </init-param>
</filter>
<filter-mapping>
    <filter-name>ESAPI-WAF</filter-name>
    <url-pattern>/webresources/*</url-pattern>
</filter-mapping>

Error while Running on server:

在服务器上运行时出错:

Jun 01, 2015 5:02:00 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter ESAPI-WAF
java.lang.ClassNotFoundException: org.owasp.esapi.waf.ESAPIWebApplicationFirewallFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:506)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:488)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:115)
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:4854)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5546)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

1 个解决方案

#1


0  

Seems that the library you are using is not in applications classpath at runtime. Please be sure to add the JAR File of that library in

似乎您正在使用的库在运行时不在应用程序类路径中。请务必在该库中添加该库的JAR文件

<WEBAPP>/WEB-INF/lib

or put it into your web containers library directory. For example in case of Apache Tomcat put that JAR file into

或将其放入您的Web容器库目录中。例如,如果Apache Tomcat将该JAR文件放入其中

<CATALINA_HOME>/lib

directory and don't forget to restart the container or redeploy your application to take effect of that change.

目录并且不要忘记重新启动容器或重新部署应用程序以使该更改生效。

#1


0  

Seems that the library you are using is not in applications classpath at runtime. Please be sure to add the JAR File of that library in

似乎您正在使用的库在运行时不在应用程序类路径中。请务必在该库中添加该库的JAR文件

<WEBAPP>/WEB-INF/lib

or put it into your web containers library directory. For example in case of Apache Tomcat put that JAR file into

或将其放入您的Web容器库目录中。例如,如果Apache Tomcat将该JAR文件放入其中

<CATALINA_HOME>/lib

directory and don't forget to restart the container or redeploy your application to take effect of that change.

目录并且不要忘记重新启动容器或重新部署应用程序以使该更改生效。