Hi,

I'm trying to run Shiro with SSO feature backed by EhCache+Terracotta. My
requirement is to have one login frontend and many web apps using the same
session/principal.

I did instructions from the Shiro Manual but have an exception. The same
exception appears with Shiro 1.1.0 and 1.2-SNAPSHOT one. Ehcache+Terracotta
looks ok - i made test of storing simple value in cache and this value was
properly stored in cache and distributed to other cluster nodes. 
I've no idea what i'm doing wrong, couldn't find anything in google and
message list archive.
Can someone give me some advice?

*Exception:*
Caused by: net.sf.ehcache.CacheException: java.io.NotSerializableException:
net.sf.ehcache.Cache
        at
org.terracotta.modules.ehcache.store.ValueModeHandlerSerialization.createTimestampedValue(ValueModeHandlerSerialization.java:68)
        at
org.terracotta.modules.ehcache.store.ClusteredStore.putInternal(ClusteredStore.java:344)
        at
org.terracotta.modules.ehcache.store.ClusteredStore.put(ClusteredStore.java:310)
        at
org.terracotta.modules.ehcache.store.ClusteredSafeStore.put(ClusteredSafeStore.java:694)
        at net.sf.ehcache.Cache.putInternal(Cache.java:1492)
        at net.sf.ehcache.Cache.put(Cache.java:1417)
        at net.sf.ehcache.Cache.put(Cache.java:1382)
        at org.apache.shiro.cache.ehcache.EhCache.put(EhCache.java:102)
        ... 40 more

*shiro.ini:*
[main]
sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
sessionDAO.activeSessionsCacheName = shiro-activeSessionsCache
sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
sessionManager.sessionDAO = $sessionDAO
securityManager.sessionManager = $sessionManager

cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
cacheManager.cacheManagerConfigFile = classpath:ehcache.xml
securityManager.cacheManager = $cacheManager

cookie = org.apache.shiro.web.servlet.SimpleCookie
cookie.name = SSOcookie
cookie.path = /
securityManager.sessionManager.sessionIdCookie = $cookie

*ehcache.xml*
<?xml version="1.0" encoding="UTF-8"?>

<ehcache name="MainCache">
    <diskStore path="java.io.tmpdir/shiro-ehcache"/>

    <defaultCache
            maxElementsInMemory="10000"
            eternal="false"
            timeToIdleSeconds="120"
            timeToLiveSeconds="120"
            overflowToDisk="false"
            diskPersistent="false"
            diskExpiryThreadIntervalSeconds="120">
        <terracotta/>
    </defaultCache>
    <cache name="shiro-activeSessionCache"
           maxElementsInMemory="10000"
           eternal="true"
           timeToLiveSeconds="0"
           timeToIdleSeconds="0"
           diskPersistent="false"
           overflowToDisk="false"
           diskExpiryThreadIntervalSeconds="600">
        <terracotta/>
    </cache>

    <terracottaConfig
url="node1.cluster.local:9510,node2.cluster.local:9510"/>
</ehcache>

*web.xml*
    <listener>
       
<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>
    <filter>
        <filter-name>ShiroFilter</filter-name>
       
<filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>ShiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>


/I can provide more config files/details about my environment if needed./


regards,
Lukasz Czerpak


--
View this message in context: 
http://shiro-user.582556.n2.nabble.com/shiro-ehcache-terracotta-opensource-tp7227413p7227413.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply via email to