I was following BalusC code to manage user authentication in Java EE 6 (http://balusc.blogspot.com/2013/01/apache-shiro-is-it-ready-for-java-ee-6.html) which works great if I stay on the same web container.
I'm facing an issue that perhaps anyone can help me.
When injecting an EJB that resides in the Web container, the SecurityUtils.getSubject()
works ok from any method of that EJB.
The problem is when I try to do it on an injected EJB from another container (even an ejb jar in the same EAR).
The error I get is:The use case is:Caused by: org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager accessible to the calling code, either bound to the org.apache.shiro.util.ThreadContext or as a vm static singleton. This is an invalid application configuration.
Managed bean A
with injected stateless session bean B
. Class A
resides in myApp.war, class B
resides in myApp.ejb, both inside myApp.ear. I am calling SecurityUtils
from class B
.
Do you have any clues on how to solve this?
I am running JSF 2, Java EE 6, JBoss 7.1.