在我的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"
}如果重新构建WAR,ehcache-core JAR将被排除在外,但在运行grails run-app时仍然会遇到相同的错误。我怀疑造成这个问题的原因是ehcache依赖项,但我不知道应该使用哪个JAR。
发布于 2018-11-28 16:57:43
升级到hibernate 3.6.10.19似乎解决了这个问题。在构建WAR时,包括以下ehcache依赖项:
https://stackoverflow.com/questions/53451212
复制相似问题