netbeans 8.0.1 cant find shiro.ini

淺唱寂寞╮ 提交于 2019-12-08 05:30:19

问题


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?


回答1:


Not necessarily,

IniWebEnvironment class which extends ResourceBasedWebEnvironment specifies default configuration locations to /WEB-INF/shiro.ini and classpath:shiro.ini




回答2:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!