I use JSF with Spring security. I implement it.
My code:
@Named("userDetailsManagerImpl")
@Scope("application")
public class UserDetailBusinessImpl implements UserDetailsService {
@Inject
private MenuBackingBean menu;
}
Everything seem to be good. However I must define MenuBackingBean is application scope. I only want session scope for it. So I change scope to session, but I got an error below:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsManagerImpl': Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton
I think this error cause by spring security set application for default scope.
I searched on Google but have no answer for this problem (maybe I have no right keyword searching). Please help me to solve, thank you
More info I used:
- JSF 2.0
- Spring security 3.1.2
- Named and Inject from JSR 330
- Scope annotation from springframework package