You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by diffuser <di...@gmail.com> on 2013/10/17 08:06:57 UTC

ehcache, how to use the specific cache?

Now my web could use ehcache. But there is another issue now.
The followed is my cache information:
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="290"
timeToLiveSeconds="300"
overflowToDisk="false"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
/>

<cache name="my.authorizationCache"
maxElementsInMemory="100"
eternal="false"
timeToLiveSeconds="600"
overflowToDisk="false"/>

Now the web always use defaultCache. But I hope use "my.authorizationCache".
How to do ? who can help me ?



--
View this message in context: http://shiro-user.582556.n2.nabble.com/ehcache-how-to-use-the-specific-cache-tp7579272.html
Sent from the Shiro User mailing list archive at Nabble.com.

RE: ehcache, how to use the specific cache?

Posted by Michael Chandler <Mi...@onassignment.com>.
You have encountered many of the same issues I've been struggling with and your contributions to this list have been very helpful.  Thanks for sharing.  You and I are both using Spring integration with Shiro and have similar configurations.

Could you tell me what modifications you made that allowed you to resolve this error?

Property 'cacheManager' threw exception;  nested exception is org.apache.shiro.cache.CacheException:
net.sf.ehcache.CacheException: Another CacheManager with sam e name 'shiroehcache1' already exists in the same VM.

-----Original Message-----
From: diffuser [mailto:diffuser.fuser@gmail.com]
Sent: Wednesday, October 16, 2013 11:45 PM
To: user@shiro.apache.org
Subject: Re: ehcache, how to use the specific cache?

I find the answer now.

in Config Ream set a property:
<property name="authorizationCacheName" value="my.authorizationCache"/>




--
View this message in context: http://shiro-user.582556.n2.nabble.com/ehcache-how-to-use-the-specific-cache-tp7579272p7579274.html
Sent from the Shiro User mailing list archive at Nabble.com.

The information transmitted, including attachments, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this e-mail in error, please notify the sender immediately by replying to the message and deleting the material from your computer.

Re: ehcache, how to use the specific cache?

Posted by diffuser <di...@gmail.com>.
I find the answer now.

in Config Ream set a property:
<property name="authorizationCacheName" value="my.authorizationCache"/>




--
View this message in context: http://shiro-user.582556.n2.nabble.com/ehcache-how-to-use-the-specific-cache-tp7579272p7579274.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: ehcache, how to use the specific cache?

Posted by diffuser <di...@gmail.com>.
BTW, I use xml configration.

	<bean id="shirocacheManager"
class="org.apache.shiro.cache.ehcache.EhCacheManager"  scope="singleton" >
		<property name="cacheManagerConfigFile" value="classpath:ehcache.xml" />
	</bean>
	
	<bean id="shirosecurityManager"
class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">  
		<property name="realm" ref="myRealm" />  
		<property name="cacheManager" ref="shirocacheManager" />
		
	</bean>

I don't want to use default cache. How to do ?



--
View this message in context: http://shiro-user.582556.n2.nabble.com/ehcache-how-to-use-the-specific-cache-tp7579272p7579273.html
Sent from the Shiro User mailing list archive at Nabble.com.