grails - 将Grails 3.1.4应用程序部署到Elastic Beanstalk时“Another unnamed CacheManager already exists in the same VM”-错误

标签 grails spring-security amazon-elastic-beanstalk database-migration grails-3.1

从大约一周前开始执行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 release notes建议将beans.cacheManager.shared设置为true。没帮助

面临类似问题的其他人建议将Hibernate cache factory_class从org.hibernate.cache.ehcache.EhCacheRegionFactory替换为org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory - this post。我认为这消除了未命名的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'}}}

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

    最佳答案

    您最近是否升级到了Hibernate 5.1.0.Final?如果是这样,那么您可能与this one.存在相同的问题。似乎没有找到解决方案,但是您可能想降级到Hibernate 5.0.9.Final,以避免当前出现此问题。

    关于grails - 将Grails 3.1.4应用程序部署到Elastic Beanstalk时“Another unnamed CacheManager already exists in the same VM”-错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36434773/

    相关文章:

    grails - 如何更改 Grails 域类 ID 字段的名称?

    ajax - 如何使用Grails的update属性SubmitToRemote

    spring-boot - 如何加快Spring Boot 2.0基本身份验证的速度?

    amazon-web-services - 错误 : 2. 0+ 平台需要服务角色。您可以提供一个带有 --service-role 选项的服务

    grails - GORM按has_many排序

    grails - 如何从服务调用 log.error()?总是给出“没有这样的属性 : log for class: gi. mypackage.$UserServiceImplementation

    java - Spring 4安全jdbc身份验证

    java - Spring 安全 : Not able to configure method security with java config

    amazon-web-services - 在 VPC 下设置 Amazon Elastic Beanstalk 应用程序

    ruby-on-rails - 使用 Puma 部署在 Elastic Beanstalk 上的 Rails 应用程序失败 - 每个请求都出现 502 错误