I added this shir.ini
under web pages under WEB-INF:
[main]
# Objects and their properties are defined here,
# Such as the securityManager, Realms and anything
# else needed to build the SecurityManager
shiro.loginUrl = /index.jsp
[users]
root = 12345,admin
guest = 12345,guest
[roles]
admin = *
[urls]
/index.xhtml = authc
/login.xhtml = authc
/info.xhtml = anon
/logout = logout
/admin/** = authc, roles[admin]
but in glassfish server 4.1 window, I got this error:
SEVERE: [admin-listener(5)] INFO org.apache.shiro.web.env.EnvironmentLoader - Starting Shiro environment initialization.
SEVERE: [admin-listener(5)] ERROR org.apache.shiro.web.env.EnvironmentLoader - Shiro environment initialization failed
SEVERE: org.apache.shiro.config.ConfigurationException: Shiro INI configuration was either not found or discovered to be empty/unconfigured.
Do you what it the cause or how to fix it?
jpl
Not necessarily,
IniWebEnvironment
class which extends ResourceBasedWebEnvironment
specifies default configuration locations to /WEB-INF/shiro.ini
and classpath:shiro.ini
I found the cause: shiro.ini must be added under source packages not web pages
来源:https://stackoverflow.com/questions/31804499/netbeans-8-0-1-cant-find-shiro-ini