My web project use spring mvc and shiro, and config the ehcache+terracotta as the session manager. it can work. The web application can startup, and user can login it. But when i edit a form then submit is(inside controller, saving the model data first, then return a redirect to client. ), the problem occur: explorer is always wating status, and the console of server doesn't print any thing.
If i move the cluster settings form ehcache.xml, the problem will not occur。
the spring configuration:
Code:
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager"
depends-on="userDao">
<property name="realm" ref="shiroDbRealm" />
<property name="sessionManager" ref="sessionManager" />
<property name="cacheManager" ref="cacheManager" />
</bean>
<bean id="sessionDAO"
class="org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO">
<property name="activeSessionsCacheName" value="shiro-activeSessionsCache" />
</bean>
<bean id="sessionManager"
class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">
<property name="sessionDAO" ref="sessionDAO" />
</bean>
<bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
<property name="cacheManagerConfigFile" value="classpath:ehcache-terracotta.xml" />
</bean>
the ehcache configuration:
Code:
<ehcache name="clusterCache">
<terracottaConfig url="192.168.1.210:9510,192.168.1.211:9510" />
<diskStore path="java.io.tmpdir/shiro-ehcache" />
<defaultCache maxElementsInMemory="100000"
maxElementsOnDisk="1000000" eternal="false" timeToIdleSeconds="120"
timeToLiveSeconds="120" overflowToDisk="false" diskPersistent="false"
diskExpiryThreadIntervalSeconds="120">
<terracotta />
</defaultCache>
<cache name="shiro-activeSessionsCache" maxElementsInMemory="100000"
maxElementsOnDisk="1000000" eternal="true" timeToLiveSeconds="0"
timeToIdleSeconds="0" diskPersistent="false" overflowToDisk="false"
diskExpiryThreadIntervalSeconds="120">
<terracotta />
</cache>
<!-- Add more cache entries as desired, for example, Realm authc/authz caching: -->
</ehcache>
the java coce:
Code:
return "redirect:/base/menu/?pid=" + pid;
please attation: if change to Code:
return "redirect:/base/menu/";
,it will be work, no pedding or watting.
Can anyone can help me? thanks