shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Parker (Created) (JIRA)" <>
Subject [jira] [Created] (SHIRO-336) Documentation related to EHCache setup needs to be clearer
Date Thu, 05 Jan 2012 04:26:39 GMT
Documentation related to EHCache setup needs to be clearer

                 Key: SHIRO-336
             Project: Shiro
          Issue Type: Improvement
          Components: Caching , Documentation
    Affects Versions: 2.0.0
         Environment: documentation
            Reporter: Jeff Parker
            Priority: Minor

See thread:

It turns out that this was a cache "problem".  AuthorizingRealm requires its own cache to
be defined and sans doing that reverts back to the default cache (2 minute cache).  The cache
HAS to be named as follows:

authorizationCacheName = getClass().getName() + DEFAULT_AUTHORIZATION_CACHE_SUFFIX;

where the suffix is ".authorizationCache".  Failing to define an eternal cache for this results
in really odd behavior.  If you override AuthorizingCache then you'll need to define the cache
using your own class name as shown below.

    <cache name="com.samples.MyCustomRealm.authorizationCache"

Maybe this is in the documentation somewhere, but I totally missed it and it caused me a lot
of time and effort to figure it out.  The documentation does say that expiring the cache without
telling Shiro about it is a very bad thing -- I agree.   I hope this bit of information benefits
somebody else. 

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message