0

Ever since about a week ago after doing a prod dbm-update I started getting this error when deploying the WAR-file to EB (run-app works fine both in dev and prod setting):

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 suggested setting beans.cacheManager.shared to true. Didn't help.

Other people facing similar issues suggested replacing Hibernate cache factory_class from org.hibernate.cache.ehcache.EhCacheRegionFactory to org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory - this post. I think it eliminated the unnamed cacheManager issue, but created another one:

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

Setting "liquibase.checkChangeLogLocation = false" and "liquibase.enabled = false" triggers yet another:

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

I'm using: Grails 3.1.4 with the AngularJS profile, Spring Security 3.0.4, Spring Security Rest 2.0.0.M2, Database Migration 2.0.0.RC4

I've also tried:

  • switching to Spring Security 3.0.2, 3.0.3
  • termimating the EC2 instance
  • re-building the entire EB environment and creating a new database
  • setting hibernate use_second_level_cache to false
  • downgrading to Grails 3.1.0
  • setting sourceSets { main { resources { srcDir 'grails-app/migrations'}}}

I'm running out of ideas and nothing has helped so far. Does anyone have an idea? Or is facing similar problems?

  • I rebuilt the Elastic Beanstalk environment, added `exclude module: 'ehcache-core'` to the `org.hibernate:hibernate-ehcache` plugin [(shown here)](http://grails-plugins.github.io/grails-spring-security-core/v3/index.html), set `liquibase.enabled = false`. Now the application doesn't show any error in the tomcat logs, but just `{"message":"Not Found","error":404}` when I visit any url on the site. Somehow .../login/auth shows a standard spring security login form. All other paths show the 404 error. Everything works in development. – Vahur Hansen Apr 14 '16 at 15:08

3 Answers3

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.

Community
  • 1
  • 1
  • Nope, Hibernate version seems to be: org.grails.plugins:hibernate4: -> 5.0.3. EhCache is org.hibernate:hibernate-ehcache: -> 4.3.11.Final – Vahur Hansen Apr 13 '16 at 20:49
0

It turned out to be an issue with the Grails 3 AWS SDK plugin. I reverted all my changes and just replaced the plugin with the AWS SDK for Java through Gradle.

You can see from the plugin page that it supports Grails up to 3.1.1, but downgrading from 3.1.4 to 3.1.1 didn't make any difference either. But yes, using AWS SDK without the plugin worked. Woo!

0

I used Spring Security Core plugin v3.0.4 and got this error too on Grails v3.1.4. Upgrading the SSC pluign to v3.1.1. fixed the issue for me.

Yuri
  • 4,254
  • 1
  • 29
  • 46