-
Notifications
You must be signed in to change notification settings - Fork 41.2k
EhCacheCacheConfiguration and Hibernate 2nd level cache aren't coexisting. #4781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
#4158 set a "hard" dependency between the I can see that the caching is triggering as part of some Sharing a sample project would help. On our side, we could find a way to figure out that you're looking for a certain cache manager (or the default one) and just use that rather than trying to create one ourselves. We are releasing 1.3.1 tomorrow so if you can provide me these information quickly, I can still act on it today. |
@snicoll I'm finally able to reproduce this locally by running on the command line as a war instead of through STS 'Run As Spring Boot App' I'm going to try to recreate this with a smaller, paired-down project as I can't post our entire source to github. I'm not sure how you want me to create a "hard" dependency. Hibernate and EhCache are both being started by Boot AutoConfig classes so I don't have control over them. As a said earlier, we used to have a |
As I said, your setup seems to be a bit special as some BPP is forcing an early init of some beans. Spring Boot puts a hard Your
|
@snicoll https://github.com/csavory/spring-boot-issues/tree/master/gh-4781 should allow you to reproduce the issue. It works fine when I run edlogics2-elrc through STS as a 'Spring Boot App', but when I try to run from the command line it breaks. From the root run 1) In STS I see these log statement early on:
And similar statements in STS when Hibernate starts
I see similar ehcache statements early on when run as a war, but no
Then when Hibernate tries to start a cache it crashes. |
@spring-issuemaster I'm not sure what the unknown issue tag is on this one. Was that a mistake? |
I added the tag. I don't know yet where the issue comes from. Nobody did a mistake (so far ;-) ) |
I was working recently on a somewhat similar problem and I believe this one is fixed as well as a side effect of #13038 - We can reopen if that turns out not be the case. |
I can't reproduce this in my local version of my app, but on our development server we are running into and issue with the EhCacheCacheConfiguration auto configuration. This started today after upgrading to spring boot 1.3. I removed our manual configuration of the ehCache where I had it configured like this:
Now EhCacheCacheConfiguration is configuring the cache, but Hibernate already builds an ehcache CacheManger earlier in the startup process because 2nd level caching is enabled. Then when
EhCacheManagerUtils.buildCacheManager()
is called it leads to this error.Is there a way to only get one of them to start?
The text was updated successfully, but these errors were encountered: