配置方式:
public void configPlugin(Plugins me) { ... //EhCache缓存 me.add(new EhCachePlugin()); }
错误异常的堆栈输出信息如下:
2015-04-14 13:40:54 [ERROR]-[Thread: main]-[com.jfinal.core.Config.startPlugins()]: Plugin start error: com.jfinal.plugin.ehcache.EhCachePlugin. java.util.ServiceConfigurationError: net.sf.ehcache.EhcacheInit: Provider net.sf.ehcache.EhcacheCoreInit not a subtype net.sf.ehcache.CacheException: java.util.ServiceConfigurationError: net.sf.ehcache.EhcacheInit: Provider net.sf.ehcache.EhcacheCoreInit not a subtype at net.sf.ehcache.LibraryInit.init(LibraryInit.java:55) at net.sf.ehcache.CacheManager.init(CacheManager.java:366) at net.sf.ehcache.CacheManager.<init>(CacheManager.java:259) at net.sf.ehcache.CacheManager.newInstance(CacheManager.java:1037) at net.sf.ehcache.CacheManager.newInstance(CacheManager.java:818) at net.sf.ehcache.CacheManager.create(CacheManager.java:799) at com.jfinal.plugin.ehcache.EhCachePlugin.createCacheManager(EhCachePlugin.java:90) at com.jfinal.plugin.ehcache.EhCachePlugin.start(EhCachePlugin.java:61) at com.jfinal.core.Config.startPlugins(Config.java:87) at com.jfinal.core.Config.configJFinal(Config.java:48) at com.jfinal.core.JFinal.init(JFinal.java:67) at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49) at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) at org.eclipse.jetty.server.Server.doStart(Server.java:277) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at com.jfinal.server.JettyServer.doStart(JettyServer.java:120) at com.jfinal.server.JettyServer.start(JettyServer.java:64) at com.jfinal.core.JFinal.start(JFinal.java:159) at me.rocs.demo.core.ApplicationConfig.main(ApplicationConfig.java:195) Caused by: java.util.ServiceConfigurationError: net.sf.ehcache.EhcacheInit: Provider net.sf.ehcache.EhcacheCoreInit not a subtype at java.util.ServiceLoader.fail(ServiceLoader.java:239) at java.util.ServiceLoader.access$300(ServiceLoader.java:185) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) at java.util.ServiceLoader$1.next(ServiceLoader.java:480) at net.sf.ehcache.LibraryInit.initService(LibraryInit.java:67) at net.sf.ehcache.LibraryInit.init(LibraryInit.java:50) ... 26 more 四月 14, 2015 1:40:54 下午 org.eclipse.jetty.util.component.AbstractLifeCycle setFailed 警告: FAILED ConfigFilter: java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.ehcache.EhCachePlugin. java.util.ServiceConfigurationError: net.sf.ehcache.EhcacheInit: Provider net.sf.ehcache.EhcacheCoreInit not a subtype java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.ehcache.EhCachePlugin. java.util.ServiceConfigurationError: net.sf.ehcache.EhcacheInit: Provider net.sf.ehcache.EhcacheCoreInit not a subtype at com.jfinal.core.Config.startPlugins(Config.java:96) at com.jfinal.core.Config.configJFinal(Config.java:48) at com.jfinal.core.JFinal.init(JFinal.java:67) at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49) at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) at org.eclipse.jetty.server.Server.doStart(Server.java:277) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at com.jfinal.server.JettyServer.doStart(JettyServer.java:120) at com.jfinal.server.JettyServer.start(JettyServer.java:64) at com.jfinal.core.JFinal.start(JFinal.java:159) at me.rocs.demo.core.ApplicationConfig.main(ApplicationConfig.java:195) Caused by: net.sf.ehcache.CacheException: java.util.ServiceConfigurationError: net.sf.ehcache.EhcacheInit: Provider net.sf.ehcache.EhcacheCoreInit not a subtype at net.sf.ehcache.LibraryInit.init(LibraryInit.java:55) at net.sf.ehcache.CacheManager.init(CacheManager.java:366) at net.sf.ehcache.CacheManager.<init>(CacheManager.java:259) at net.sf.ehcache.CacheManager.newInstance(CacheManager.java:1037) at net.sf.ehcache.CacheManager.newInstance(CacheManager.java:818) at net.sf.ehcache.CacheManager.create(CacheManager.java:799) at com.jfinal.plugin.ehcache.EhCachePlugin.createCacheManager(EhCachePlugin.java:90) at com.jfinal.plugin.ehcache.EhCachePlugin.start(EhCachePlugin.java:61) at com.jfinal.core.Config.startPlugins(Config.java:87) ... 18 more Caused by: java.util.ServiceConfigurationError: net.sf.ehcache.EhcacheInit: Provider net.sf.ehcache.EhcacheCoreInit not a subtype at java.util.ServiceLoader.fail(ServiceLoader.java:239) at java.util.ServiceLoader.access$300(ServiceLoader.java:185) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) at java.util.ServiceLoader$1.next(ServiceLoader.java:480) at net.sf.ehcache.LibraryInit.initService(LibraryInit.java:67) at net.sf.ehcache.LibraryInit.init(LibraryInit.java:50) ... 26 more 四月 14, 2015 1:40:54 下午 org.eclipse.jetty.webapp.WebAppContext doStart 警告: Failed startup of context o.e.j.w.WebAppContext{/,file:/D:/Peng/_repo/src/_2015/jb2_demo/WebRoot/} java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.ehcache.EhCachePlugin. java.util.ServiceConfigurationError: net.sf.ehcache.EhcacheInit: Provider net.sf.ehcache.EhcacheCoreInit not a subtype at com.jfinal.core.Config.startPlugins(Config.java:96) at com.jfinal.core.Config.configJFinal(Config.java:48) at com.jfinal.core.JFinal.init(JFinal.java:67) at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49) at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) at org.eclipse.jetty.server.Server.doStart(Server.java:277) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at com.jfinal.server.JettyServer.doStart(JettyServer.java:120) at com.jfinal.server.JettyServer.start(JettyServer.java:64) at com.jfinal.core.JFinal.start(JFinal.java:159) at me.rocs.demo.core.ApplicationConfig.main(ApplicationConfig.java:195) Caused by: net.sf.ehcache.CacheException: java.util.ServiceConfigurationError: net.sf.ehcache.EhcacheInit: Provider net.sf.ehcache.EhcacheCoreInit not a subtype at net.sf.ehcache.LibraryInit.init(LibraryInit.java:55) at net.sf.ehcache.CacheManager.init(CacheManager.java:366) at net.sf.ehcache.CacheManager.<init>(CacheManager.java:259) at net.sf.ehcache.CacheManager.newInstance(CacheManager.java:1037) at net.sf.ehcache.CacheManager.newInstance(CacheManager.java:818) at net.sf.ehcache.CacheManager.create(CacheManager.java:799) at com.jfinal.plugin.ehcache.EhCachePlugin.createCacheManager(EhCachePlugin.java:90) at com.jfinal.plugin.ehcache.EhCachePlugin.start(EhCachePlugin.java:61) at com.jfinal.core.Config.startPlugins(Config.java:87) ... 18 more Caused by: java.util.ServiceConfigurationError: net.sf.ehcache.EhcacheInit: Provider net.sf.ehcache.EhcacheCoreInit not a subtype at java.util.ServiceLoader.fail(ServiceLoader.java:239) at java.util.ServiceLoader.access$300(ServiceLoader.java:185) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) at java.util.ServiceLoader$1.next(ServiceLoader.java:480) at net.sf.ehcache.LibraryInit.initService(LibraryInit.java:67) at net.sf.ehcache.LibraryInit.init(LibraryInit.java:50) ... 26 more 四月 14, 2015 1:40:55 下午 org.eclipse.jetty.server.AbstractConnector doStart 信息: Started SelectChannelConnector@0.0.0.0:8080 Starting Complete. Welcome To The JFinal World :)
jfinal官方网站有一个 jfinal-1.9-all.zip供下载,里面提供了ehcache的所需要的jar包,试一下这个应该可以,都是经过严格测试的<divclass="ref">
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。