@nextleaf
2018-06-30T02:04:22.000000Z
字数 2022
阅读 1580
SSH
整合
org.apache.catalina.core.StandardContext.startInternal One or more Filters failed to start.
到tomcat的logs目录下,打开localhost-时间.log,例如localhost.2018-06-30.log
查看;
如果没有或者文件的修改时间不是此时的,尝试手动发布和启动tomcat,再打开该文件查看。
解决办法:
Struts2
struts2不同版本核心filter在web.xml中的配置:
查阅官方文档得知:
如果,filter package in Struts >= 2.5,这样配置
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
如果,2.1.3<=filter package in Struts < 2.5,这样配置
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
如果filter package in Struts < 2.1.3,这样配置
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
详细链接IntelliJ IDEA java-web 初学之容易遇到的问题及解决办法
30-Jun-2018 00:09:32.943 严重 [localhost-startStop-1] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [struts2]
java.lang.NoClassDefFoundError: ognl/DefaultMemberAccess
报错:
30-Jun-2018 00:09:32.943 严重 [localhost-startStop-1]org.apache.catalina.core.StandardContext.filterStart Exception starting filter[struts2]
java.lang.NoClassDefFoundError: ognl/DefaultMemberAccess
....
Caused by:java.lang.ClassNotFoundException: ognl.DefaultMemberAccess
既然找不到类,尝试在任意类中
import ognl.DefaultMemberAccess
按 alt
enter
添加依赖项,应该是高版本的ognl并没有DefaultMemberAccess类,将高版本的ognl注释掉。
添加的依赖项为:
<dependency>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
<version>3.1.15</version>
<!--<scope>test</scope>-->
</dependency>
将<scope>test</scope>
注释掉。