控制台错误信息:
2013-4-26 11:02:11 net.sf.ehcache.constructs.web.filter.Filter init
严重: Could not initialise servlet filter.
java.lang.NullPointerException
at net.sf.ehcache.CacheManager.replaceCacheWithDecoratedCache(CacheManager.java:874)
at net.sf.ehcache.constructs.web.filter.CachingFilter.doInit(CachingFilter.java:87)
at net.sf.ehcache.constructs.web.filter.Filter.init(Filter.java:196)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4001)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4651)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
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:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
web.xml内容:
<filter>
<filter-name>SimplePageCachingFilter</filter-name>
<filter-class>net.sf.ehcache.constructs.web.filter.SimplePageCachingFilter</filter-class>
</filter>
<!-- This is a filter chain. They are executed in the order below. Do not change the order. -->
<filter-mapping>
<filter-name>SimplePageCachingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
ehcache.xml内容:
<cache name ="SimplePageCachingFilter"
maxElementsInMemory ="10"
maxElementsOnDisk ="10"
eternal ="false"
overflowToDisk ="true"
diskSpoolBufferSizeMB ="20"
timeToIdleSeconds ="10"
timeToLiveSeconds ="10"
memoryStoreEvictionPolicy ="LFU"/>
用代码的方式把错误贴出来吧,格式可能好看点、<divclass="ref">
<imgsrc="http://static.oschina.net/uploads/space/2015/0906/164223_ekoD_1051990.bmp"alt="">
你的ehcache.xml中需要增加name="SimplePageCachingFilter"的cache配置项,今天我也遇到了就是这样解决的。
加了还是报错。<spanstyle="font-size:13.3333px;">怎么解决的啊?我也遇到了同样的问题版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。