大约一周前,在执行 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'}}}
我的想法不多了,到目前为止没有任何帮助。有人有想法吗?还是面临类似的问题?