Hi Minas,

I think this is a valid issue - please open it in Jira.  Any patches
would be welcome!

Best regards,

Les

On Tue, Dec 7, 2010 at 2:39 AM, Minas Manthos <[email protected]> wrote:
>
> short: Initializable.init() from AuthorizingRealm is not called by
> LifecycleBeanPostProcessor when using ShiroFilterFactoryBean
>
> long: ShiroFilterFactoryBean itself is a BeanPostProcessor, like
> LifecycleBeanPostProcessor too. So during
> AbstractApplicationContext.registerBeanPostProcessors() these two beans are
> created and added to nonOrderedPostProcessors, after then they get
> registered. At this execution point ShiroFilterFactoryBean is already
> created with its SecurityManager and defined Realms. So
> LifecycleBeanPostProcessor will not effect anymore on Realms init.
>
> Can anyone confirm before I create an issue.
>
> Thanks.
>
> shiro 1.1, spring 3.0
>
> PS.
> to reproduce just replace in shiro samples the JdbcRealm (wich does not need
> a init) with a PropertiesRealm. Init method is never called so definitions
> never created from properties file...
>
> as workaround I just implement the Ordered (org.springframework.core)
> interface to LifecycleBeanPostProcessor with LOWEST_PRECEDENCE. Ordered
> PostProcessors are processed and registered before non-ordered. So
> LifecycleBeanPostProcessor gets registered before ShiroFilterFactoryBean is
> created.
> --
> View this message in context: 
> http://shiro-user.582556.n2.nabble.com/Shiro-and-Spring-with-ShiroFilterFactoryBean-tp5811127p5811127.html
> Sent from the Shiro User mailing list archive at Nabble.com.

Reply via email to