This is what happens when I run my junit tests...
Another CacheManager with same name \'cacheManager\' already exists in the same VM. Please
provide unique
For future readers, the cause of this problem in my case was that in my pom.xml file I had imported the hibernate-ehcache library, which unknown to me also already contained the ehcache library, and then explicitly imported the net.sf.ehache libray.
This seemed to work fine when I was running as a standalone app (a command line utility for example) but it caused the error in the original post when running on a tomcat server.
Changing my pom file from:
org.hibernate
hibernate-ehcache
5.0.2.Final
net.sf.ehcache
ehcache
2.7.4
To:
org.hibernate
hibernate-ehcache
5.0.2.Final
Fixed the problem. If anyone has any idea why the problem only appeared when running in a tomcat container I'd be interested to know..