GitHub user AndrewG10i added a comment to the discussion: How to get 
SecurityManager once Jakarta EE EnvironmentLoaderListener (@WebListener) 
triggered and Shiro environment initialized?

In my case it is rather about Listener `@WebListener 
org.apache.shiro.ee.listeners.EnvironmentLoaderListener`, not Filter.
`EnvironmentLoaderListener` initializes Shiro from INI-config, thus I need to 
hook to it. Here I am dealing with scheduled background task, not a Request 
context, thus Filter is bit not related.

What I have tried:
1. To preserve the functionality provided by shiro-jakarta-ee package - I am 
trying to make `@WebListener 
org.apache.shiro.ee.listeners.EnvironmentLoaderListener` starting first in 
chain of listeners by creating my own listener class (e.g. 
`MyEnvironmentLoaderListener`) which extends 
`org.apache.shiro.ee.listeners.EnvironmentLoaderListener`. And I defined it as 
the first `<listener>` in web.xml.
2. I added `org.apache.shiro.ee.disabled=true` to web.xml (to disable the 
original `@WebListener EnvironmentLoaderListener`) and overrided 
`isShiroEEDisabled` to always return `false` in my 
`MyEnvironmentLoaderListener` implementation.
3. The implementation of `MyEnvironmentLoaderListener` seems to work fine until 
it doesn't: 1) those timers triggered by hazelcast can successfully get SecMgr 
via `SecurityUtils.getSecurityManager()` but 2) login via web UI gets broken, 
it says `java.lang.IllegalStateException: Configuration error: No realms have 
been configured! ...`. And that I could not resolve yet...

Any ideas? Thanks!

GitHub link: 
https://github.com/apache/shiro/discussions/2445#discussioncomment-15439297

----
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]

Reply via email to