Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Nguyen Trong Tri
Error when cluster Liferay Portal 6.1 with Terracotta Ehcache
July 3, 2012 9:07 PM
Answer

Nguyen Trong Tri

Rank: New Member

Posts: 3

Join Date: July 3, 2012

Recent Posts

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:
 12012-07-03 09:53:33,865 INFO - Terracotta 3.6.1, as of 20120125-112642 (Revision 19619 by cruise@su10vmo124 from 3.6.1)
 2  2012-07-03 09:53:34,286 INFO - Successfully loaded base configuration from server at '192.168.2.202:9510'.
 3  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'.
 4  2012-07-03 09:53:34,406 INFO - Log file: '/home/administrator/terracotta/client-logs/terracotta-client.log'.
 5  2012-07-03 09:53:36,344 INFO - Connection successfully established to server at 192.168.2.202:9510
 6  09:54:13,902 ERROR [ContextLoader:227] Context initialization failed
 7  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:
 8  1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
 9  2. Shutdown the earlier cacheManager before creating new one with same name.
10  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]
11          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
12          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
13          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
14          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
15          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
16          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
17          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
18          at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)
19          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
20          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
21          at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
22          at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
23          at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
24          at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:159)
25          at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)
26          at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260)
27          at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
28          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
29          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)
30          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
31          at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
32          at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1581)
33          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
34          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
35          at java.util.concurrent.FutureTask.run(FutureTask.java:166)
36          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
37          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
38          at java.lang.Thread.run(Thread.java:636)
39  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:
40  1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
41  2. Shutdown the earlier cacheManager before creating new one with same name.
42  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]
43          at net.sf.ehcache.hibernate.EhCacheRegionFactory.start(EhCacheRegionFactory.java:89)
44          at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:238)
45          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872)
46          at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
47          at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
48          at com.liferay.portal.spring.hibernate.PortalHibernateConfiguration.buildSessionFactory(PortalHibernateConfiguration.java:60)
49          at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
50          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
51          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
52          ... 27 more
53  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:
54  1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
55  2. Shutdown the earlier cacheManager before creating new one with same name.
56  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]
57          at net.sf.ehcache.CacheManager.assertNoCacheManagerExistsWithSameName(CacheManager.java:457)
58          at net.sf.ehcache.CacheManager.init(CacheManager.java:354)
59          at net.sf.ehcache.CacheManager.<init>(CacheManager.java:242)
60          at net.sf.ehcache.hibernate.EhCacheRegionFactory.start(EhCacheRegionFactory.java:79)
61          ... 35 more



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.
Tom Mahy
RE: Error when cluster Liferay Portal 6.1 with Terracotta Ehcache
September 11, 2012 2:15 AM
Answer

Tom Mahy

Rank: Regular Member

Posts: 103

Join Date: May 11, 2011

Recent Posts

I have the exact same problem. Did you ever find an answer ?
Veeresh Hubballi
RE: Error when cluster Liferay Portal 6.1 with Terracotta Ehcache
December 5, 2012 10:40 PM
Answer

Veeresh Hubballi

Rank: New Member

Posts: 3

Join Date: December 4, 2012

Recent Posts

One more victim...@Tom and Nguyen did you guys got solution
Tom Mahy
RE: Error when cluster Liferay Portal 6.1 with Terracotta Ehcache
December 5, 2012 10:44 PM
Answer

Tom Mahy

Rank: Regular Member

Posts: 103

Join Date: May 11, 2011

Recent Posts

We were loosing too much time on this. So we went back to the default rmi method. sorry.