Fórumok

Error when cluster Liferay Portal 6.1 with Terracotta Ehcache

Nguyen Trong Tri, módosítva 11 év-val korábban

Error when cluster Liferay Portal 6.1 with Terracotta Ehcache

New Member Bejegyzések: 3 Csatlakozás dátuma: 2012.07.04. Legújabb bejegyzések
I have 2 server.
- Server1: OS is Ubuntu server 10.04 LTS. Run Liferay Portal 6.1 CE. (IP: 192.168.2.60)
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.13) (6b20-1.9.13-0ubuntu1~10.04.1)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)

- Server2: OS is Ubuntu desktop 12.04 LTS. Run Terracotta 3.6.1 (ehcache 2.5.1) (IP: 192.168.2.202)

I want create cluster Liferay with Terracotta Ehcache.
I install Ehcache follow instruction:
http://www.liferay.com/web/mika.koivisto/blog/-/blogs/how-do-i-cluster-liferay-with-terracotta-
Now when I startup Liferay, everything looks good through the terracotta startup and then I start getting exceptions:
2012-07-03 09:53:33,865 INFO - Terracotta 3.6.1, as of 20120125-112642 (Revision 19619 by cruise@su10vmo124 from 3.6.1)
  2012-07-03 09:53:34,286 INFO - Successfully loaded base configuration from server at '192.168.2.202:9510'.
  2012-07-03 09:53:34,360 INFO - Successfully loaded base configuration from file at '/usr/local/liferay/tomcat-7.0.23/temp/tc-config4511789390406410310.xml'.
  2012-07-03 09:53:34,406 INFO - Log file: '/home/administrator/terracotta/client-logs/terracotta-client.log'.
  2012-07-03 09:53:36,344 INFO - Connection successfully established to server at 192.168.2.202:9510
  09:54:13,902 ERROR [ContextLoader:227] Context initialization failed
  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]
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)
          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
          at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
          at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
          at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
          at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:159)
          at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)
          at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260)
          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)
          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
          at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
          at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1581)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
          at java.util.concurrent.FutureTask.run(FutureTask.java:166)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
          at java.lang.Thread.run(Thread.java:636)
  Caused by: 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]
          at net.sf.ehcache.hibernate.EhCacheRegionFactory.start(EhCacheRegionFactory.java:89)
          at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:238)
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872)
          at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
          at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
          at com.liferay.portal.spring.hibernate.PortalHibernateConfiguration.buildSessionFactory(PortalHibernateConfiguration.java:60)
          at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
          ... 27 more
  Caused by: 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(CacheManager.java:457)
          at net.sf.ehcache.CacheManager.init(CacheManager.java:354)
          at net.sf.ehcache.CacheManager.<init>(CacheManager.java:242)
          at net.sf.ehcache.hibernate.EhCacheRegionFactory.start(EhCacheRegionFactory.java:79)
          ... 35 more</init></init>



I just do it follow these instruction. I try change "name" attribute on the "ehcache" element, but not work.
I was just used Liferay and Terracotta for a short time, could you show me how to fix error this in a detailed way ?
Thanks.
Sorry for English not good.
thumbnail
Tom Mahy, módosítva 11 év-val korábban

RE: Error when cluster Liferay Portal 6.1 with Terracotta Ehcache

Regular Member Bejegyzések: 103 Csatlakozás dátuma: 2011.05.11. Legújabb bejegyzések
I have the exact same problem. Did you ever find an answer ?
Veeresh Hubballi, módosítva 11 év-val korábban

RE: Error when cluster Liferay Portal 6.1 with Terracotta Ehcache

New Member Bejegyzések: 3 Csatlakozás dátuma: 2012.12.04. Legújabb bejegyzések
One more victim...@Tom and Nguyen did you guys got solution
thumbnail
Tom Mahy, módosítva 11 év-val korábban

RE: Error when cluster Liferay Portal 6.1 with Terracotta Ehcache

Regular Member Bejegyzések: 103 Csatlakozás dátuma: 2011.05.11. Legújabb bejegyzések
We were loosing too much time on this. So we went back to the default rmi method. sorry.