[英]exception when initialising cache causes “grails run-app” to fail
在我的Grails 2.5.4应用中,我安装了以下插件
compile ":cache:1.1.8"
runtime ":cache-ehcache:1.0.5"
当我运行grails run-app
,在启动时出现以下错误
java.lang.NullPointerException
at grails.plugin.cache.ehcache.GrailsEhCacheManagerFactoryBean$ReloadableCacheManager.rebuild(GrailsEhCacheManagerFactoryBean.java:171)
at grails.plugin.cache.ehcache.EhcacheConfigLoader.reload(EhcacheConfigLoader.groovy:63)
at grails.plugin.cache.ConfigLoader.reload(ConfigLoader.groovy:42)
at CacheGrailsPlugin.reloadCaches(CacheGrailsPlugin.groovy:202)
at CacheGrailsPlugin$_closure3.doCall(CacheGrailsPlugin.groovy:158)
如果我构建WAR并查看lib
目录,则它包含以下两个依赖项:
根据本期中的建议,我在BuildConfig
排除了传递性ehcache-core
依赖性
runtime (":hibernate:3.6.10.18") {
excludes "ehcache-core"
}
如果我重建时期, ehcache-core
JAR 被排除,但我仍然得到同样的错误在启动时,当我运行grails run-app
。 我怀疑问题的原因是ehcache依赖关系,但我不知道应该使用哪个JAR。
升级到休眠状态3.6.10.19似乎可以解决此问题。 构建WAR时,包括以下ehcache依赖项:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.