GitHub user AndrewG10i created a discussion: How to get SecurityManager once Jakarta EE EnvironmentLoaderListener (@WebListener) triggered and Shiro environment initialized?
Hi, When running a Jakarta EE application on Payara 6.x (latest), I observe that `@WebListener org.apache.shiro.ee.listeners.EnvironmentLoaderListener` is executed last. I need to trigger custom logic - specifically, to schedule a task and propagate a security context (Subject or SecurityManager) - once the Shiro environment has been fully initialized. However, I do not see a straightforward way to do this, since the container invokes Shiro’s EnvironmentLoaderListener last in the startup sequence. The task itself is scheduled via Hazelcast and therefore executes outside of the Jakarta EE context. As a result, I cannot @Inject the SecurityManager, and `SecurityUtils.getSecurityManager()` also fails, throwing an exception indicating that no SecurityManager is available. What would be an appropriate solution for this scenario? P.S. I have already tried multiple approaches and workarounds, but each has run into limitations that prevent achieving the desired behavior. GitHub link: https://github.com/apache/shiro/discussions/2445 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
