org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'counterHibernateSessionFactory' defined in class path resource [META-INF/hibernate-spring.xml]: Invocation of init method failed; nested exception is org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Another CacheManager with same name 'liferay-hibernate' 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. The source of the existing CacheManager is: URLConfigurationSource [url=file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/classes/my-ehcache/hibernate-terracotta.xml]

Terracotta | jackson0 | 5 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Re:How to setup Ehcache in Terracotta ?

    Terracotta | 5 years ago | jackson0
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'counterHibernateSessionFactory' defined in class path resource [META-INF/hibernate-spring.xml]: Invocation of init method failed; nested exception is org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Another CacheManager with same name 'liferay-hibernate' 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. The source of the existing CacheManager is: URLConfigurationSource [url=file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/classes/my-ehcache/hibernate-terracotta.xml]
  2. 0

    Error: Another CacheManager with same name 'myCache' already exists in the same VM.

    terracotta.org | 1 year ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'counterHibernateSessionFactory' defined in class path resource [META-INF/hibernate-spring.xml]: Invocation of init method failed; nested exception is org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Another CacheManager with same name 'liferay-hibernate' 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. The source of the existing CacheManager is: URLConfigurationSource [url=file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/classes/my-ehcache/hibernate-terracotta.xml]
  3. 0

    RE: Error when cluster Liferay Portal 6.1 with Terracotta Ehcache - Forums | Liferay

    liferay.com | 1 year ago
    org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Another CacheManager with same name 'liferay-hibernate' 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.   The source of the existing CacheManager is: URLConfigurationSource [url=file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/classes/my-ehcache/hibernate-terracotta.xml]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Getting error in Jaspersoft server (5.6.1) inst... | CA Communities

    ca.com | 1 year ago
    beans.factory.BeanCreationException: Error creating bean with name 'accessService' defined in file [D:\jaspersoft\buildomatic\conf_source\iePro\applicationContext-events-logging.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sessionFactory': FactoryBean which is currently in creation returned null from getObject
  6. 0

    ehcache using hibernate second level cache issue(2.5 above version)

    terracotta.org | 1 year ago
    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. The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]

    1 unregistered visitors

    Root Cause Analysis

    1. net.sf.ehcache.CacheException

      Another CacheManager with same name 'liferay-hibernate' 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. The source of the existing CacheManager is: URLConfigurationSource [url=file:/usr/local/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/classes/my-ehcache/hibernate-terracotta.xml]

      at net.sf.ehcache.CacheManager.assertNoCacheManagerExistsWithSameName()
    2. Ehcache
      EhCacheRegionFactory.start
      1. net.sf.ehcache.CacheManager.assertNoCacheManagerExistsWithSameName(CacheManager.java:457)
      2. net.sf.ehcache.CacheManager.init(CacheManager.java:354)
      3. net.sf.ehcache.CacheManager.<init>(CacheManager.java:242)
      4. net.sf.ehcache.hibernate.EhCacheRegionFactory.start(EhCacheRegionFactory.java:79)
      4 frames
    3. Hibernate
      SessionFactoryImpl.<init>
      1. org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:238)
      1 frame
    4. Hibernate
      Configuration.buildSessionFactory
      1. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872)
      1 frame
    5. Hibernate
      LocalSessionFactoryBean.buildSessionFactory
      1. org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
      2. org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
      2 frames
    6. Liferay Portal Impl
      PortalHibernateConfiguration.buildSessionFactory
      1. com.liferay.portal.spring.hibernate.PortalHibernateConfiguration.buildSessionFactory(PortalHibernateConfiguration.java:60)
      1 frame
    7. Hibernate
      AbstractSessionFactoryBean.afterPropertiesSet
      1. org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
      1 frame
    8. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      5. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
      6. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      7. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
      8. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
      9. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)
      9 frames
    9. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
      2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
      2 frames
    10. Spring
      ContextLoaderListener.contextInitialized
      1. org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
      2. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
      3. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
      3 frames
    11. Liferay Portal Impl
      PortalContextLoaderListener.contextInitialized
      1. com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:159)
      1 frame
    12. Glassfish Core
      HostConfig$DeployDescriptor.run
      1. org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)
      2. org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260)
      3. org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      4. org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
      5. org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)
      6. org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
      7. org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
      8. org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1581)
      8 frames
    13. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      2. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      3. java.util.concurrent.FutureTask.run(FutureTask.java:166)
      4. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      5. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      6. java.lang.Thread.run(Thread.java:636)
      6 frames