demionfo
neo
Joined: 01/03/2014 08:31:35
Messages: 1
Offline
|
Added Terracotta in my project Shiro+Ehcach+Spring+Hibernate.
file ehcache.xml:
<cache name="shiro-activeSessionCache"
maxElementsInMemory="100000"
eternal="true"
timeToLiveSeconds="0"
timeToIdleSeconds="0"
diskPersistent="false"
overflowToDisk="false"
diskExpiryThreadIntervalSeconds="120">
<terracotta/>
</cache>
<terracottaConfig url="localhost:9510"/>
file shiro.xml
<bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager" >
<property name="cacheManagerConfigFile" value="classpath:ehcache.xml" />
</bean>
<bean id="sessionDAO"
class="org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO">
<property name="activeSessionsCacheName" value="shiro-activeSessionCache" />
</bean>
I get the following error:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.identity.Identity.roles, no session or session was closed
Please help me !! What I missed in the Terracotta or Hibernate?
Thanks in advance.
|