jfinal ehcache问题? 400 报错
Jfinal确实很好。 这两天一直在照着demo在搭。 今天想加上ehcache. 以下是相关代码:
控制器:
@Before(CacheInterceptor.class) @CacheName("stocklist") public void index() { setAttr("stockPage", Stock.me.paginate(getParaToInt(0, 1), 5)); renderJsp("StockIndex.jsp"); }
<defaultCache name ="stocklist" maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" maxElementsOnDisk="10000000" diskPersistent="false" diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU" />
严重: /stock/ java.lang.NullPointerException at com.jfinal.plugin.ehcache.CacheKit.getOrAddCache(CacheKit.java:42) at com.jfinal.plugin.ehcache.CacheKit.get(CacheKit.java:63) at com.jfinal.plugin.ehcache.CacheInterceptor.intercept(CacheInterceptor.java:55) at com.jfinal.aop.Invocation.invoke(Invocation.java:65) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:78) at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) 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)
不知道是怎么回事? @Jfinal
谢谢。
在 YourJFinalConfig 中添加即可打完收工:
me.add(new EhCachePlugin());
@紫电清霜 的jfinal-bbs对ehcache用的比较精巧的http://www.oschina.net/p/jfinal-bbs,你可以参考参考~
######@孤独的3. 403错误。 不过论坛页面的截图挺好看。 ######@Jfinal 大神有没遇过下面这种问题?jfinal整合ehcache使用时,有时候经常遇到这个异常信息
java.lang.IllegalStateException: The CacheManager has been shut down. It can no longer be used. at net.sf.ehcache.CacheManager.checkStatus(CacheManager.java:1621) at net.sf.ehcache.CacheManager.getCache(CacheManager.java:1155) at com.jfinal.plugin.ehcache.CacheKit.getOrAddCache(CacheKit.java:42) at com.jfinal.plugin.ehcache.CacheKit.get(CacheKit.java:63)
######
@Jfinal 大神有没遇过下面这种问题?jfinal整合ehcache使用时,有时候经常遇到这个异常信息
java.lang.IllegalStateException: The CacheManager has been shut down. It can no longer be used. at net.sf.ehcache.CacheManager.checkStatus(CacheManager.java:1621) at net.sf.ehcache.CacheManager.getCache(CacheManager.java:1155) at com.jfinal.plugin.ehcache.CacheKit.getOrAddCache(CacheKit.java:42) at com.jfinal.plugin.ehcache.CacheKit.get(CacheKit.java:63)
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。