To provide additional information, I have a no-arg constructor in my realm. After calling super(), I just added a call to init() in it to see if I could get the additional output you mentioned. The log output follows. It looks like the default cache manager is created after the realm.
Should the security manager initialize the realm or should the realm initialize itself? [com.jud.realm.AdamRealm] AdamRealm created [org.jsecurity.realm.AuthorizingRealm] Initializing authorization cache. [org.jsecurity.realm.AuthorizingRealm] No cache implementation set. Checking cacheManager... [org.jsecurity.realm.AuthorizingRealm] No cache or cacheManager properties have been set. Authorization caching is disabled. [com.jud.realm.AdamRealm] AdamRealm initialized [com.jud.realm.AdamRealm] Realm Name: com.palmharbor.jud.realm.AdamRealm_0 [org.jsecurity.mgt.CachingSecurityManager] Attempting to initialize default CacheManager using EhCache... [org.jsecurity.cache.ehcache.EhCacheManager] cacheManager property not set. Constructing CacheManager instance... [org.jsecurity.io.ResourceUtils] Opening resource from class path [org/jsecurity/cache/ehcache/ehcache.xml]... [org.jsecurity.cache.ehcache.EhCacheManager] instantiated Ehcache CacheManager instance. [org.jsecurity.cache.ehcache.EhCacheManager] implicit cacheManager created successfully. [org.jsecurity.web.DefaultWebSecurityManager] http mode - enabling ServletContainerSessionManager (Http Sessions) -----Original Message----- From: Thomas Skowronek [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2008 2:17 PM To: [email protected] Cc: [EMAIL PROTECTED] Subject: RE: [grails-user] JSecurity Plugin, AbstractLdapRealm and Caching My apologies for the slow response. Vacation. With trace enabled, the only output that I get from AuthorizingRealm is the following in getAuthorizationInfo(). 2008-10-13 13:33:26,896 TRACE [org.jsecurity.realm.AuthorizingRealm] Retrieving AuthorizationInfo for principals [EMAIL PROTECTED] There is no output from initAuthorizationCache(). Thomas -----Original Message----- From: Les Hazlewood [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 07, 2008 6:08 PM To: [email protected] Cc: [EMAIL PROTECTED] Subject: Re: [grails-user] JSecurity Plugin, AbstractLdapRealm and Caching You are indeed correct that it should be caching the AuthorizationInfo lookup for role/permission checks - at least that is what the code 'says'. There are a few trace/debug/info log messages in AuthorizingRealm that are printed when an authorization check occurs, particularly in the initAuthorizationCache() and getAuthorizationInfo() methods . Do you have that output? - Les
