Spring Security offers many powerful security mechanisms but it doesn't fit properly into a Java EE (EJB) environment. One problem is that Spring Security stores the SecurityContext in a ThreadLocal object which is not suitable for clusters. Spring Security relies on services (AOP for example) from Spring core which are not available if the EJB container manages the object. And Spring Security needs Spring core to wire itself, what I'd like to avoid since Java EE has already dependency injection mechanisms.
Is there a security framework tailor-made for Java EE? I'd like to have ACLs or a more flexible role mechanisms for example.