0

大约一周前,在执行 prod dbm-update 之后,我在将 WAR 文件部署到 EB 时开始出现此错误(run-app 在 dev 和 prod 设置中都可以正常工作):

Caused by: org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following: 1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary 2. Shutdown the earlier cacheManager before creating new one with same name.

Grails 2.5.0 发行说明建议将 beans.cacheManager.shared 设置为 true。没有帮助。

其他面临类似问题的人建议将 Hibernate 缓存 factory_class 从 org.hibernate.cache.ehcache.EhCacheRegionFactory 替换为 org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory - 这篇文章。我认为它消除了未命名的 cacheManager 问题,但创建了另一个问题:

Caused by: java.io.FileNotFoundException: class path resource [db/changelog/db.changelog-master.yaml] cannot be resolved to URL because it does not exist

设置“liquibase.checkChangeLogLocation = false”和“liquibase.enabled = false”会触发另一个:

Caused by: org.grails.core.exceptions.GrailsConfigurationException: Error configuring dynamic methods for plugin [springSecurityCore:3.0.4]: null

我正在使用:带有 AngularJS 配置文件的 Grails 3.1.4、Spring Security 3.0.4、Spring Security Rest 2.0.0.M2、数据库迁移 2.0.0.RC4

我也试过:

  • 切换到 Spring Security 3.0.2、3.0.3
  • 终止 EC2 实例
  • 重新构建整个EB环境并创建一个新的数据库
  • 将休眠 use_second_level_cache 设置为 false
  • 降级到 Grails 3.1.0
  • 设置 sourceSets { main { 资源 { srcDir 'grails-app/migrations'}}}

我的想法不多了,到目前为止没有任何帮助。有人有想法吗?还是面临类似的问题?

4

3 回答 3

1

Did you recently upgrade to Hibernate 5.1.0.Final ? If so, then you might have the same issue as this one. No solution seems to have been found, but you might want to downgrade to Hibernate 5.0.9.Final to avoid this issue for now.

于 2016-04-12T13:34:34.900 回答
0

我使用 Spring Security Core 插件 v3.0.4 并且在 Grails v3.1.4 上也遇到了这个错误。将 SSC 插件升级到 v3.1.1。为我解决了这个问题。

于 2016-06-29T07:18:03.567 回答
0

原来是 Grails 3 AWS SDK 插件存在问题。我恢复了所有更改,只是通过 Gradle 将插件替换为适用于 Java 的 AWS 开发工具包。

从插件页面可以看出,它支持 Grails 到 3.1.1,但是从 3.1.4 降级到 3.1.1 也没有任何区别。但是,是的,在没有插件的情况下使用 AWS SDK 是可行的。哇!

于 2016-04-16T09:20:01.253 回答