在我的Grails2.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)
如果我发动了战争,看看
lib
目录,它包含以下两个依赖项:
根据中的建议
this issue
ehcache-core
依赖于
BuildConfig
runtime (":hibernate:3.6.10.18") {
excludes "ehcache-core"
}
如果我重建这场战争
ehcache内核
罐子
是
排除,但在运行时,启动时仍会出现相同的错误
. 我怀疑问题的原因是ehcache依赖项,但我不知道应该使用哪个JAR。