ShiroFilterFactoryBean and a spring data mongodb realm
I'm using shiro with spring data and mongodb in a web application.
I've created a simple mongodb realm which is also configured via spring.
I'm also using the spring DelegatingFilterProxy along with ShiroFilterFactoryBean.
when I try to use it I invariably get:
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext
the problem is that spring-data-mongodb requires a spring ApplicationEventMulticaster to have been initialised before it can be used.
ShiroFilterFactoryBean is a beanPostProcessor, and as such, during initialisation, spring attempts to configure its realms(and hence my realm and spring data mongo based userDao).
it fails because ApplicationEventMulticaster has not yet been created.
the relevant part in spring.