【问题标题】:netbeans 8.0.1 cant find shiro.ininetbeans 8.0.1 找不到 shiro.ini
【发布时间】:2015-10-26 13:49:13
【问题描述】:

我在WEB-INF下的网页下添加了这个shir.ini

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

但是在 glassfish server 4.1 窗口中,我收到了这个错误:

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.

您是什么原因造成的,或者如何解决?

【问题讨论】:

  • 找到原因:shiro.ini必须加在源码包下而不是网页下

标签: java netbeans glassfish shiro


【解决方案1】:

不一定,

IniWebEnvironment 扩展 ResourceBasedWebEnvironment 的类将默认配置位置指定为 /WEB-INF/shiro.iniclasspath:shiro.ini

【讨论】:

    【解决方案2】:

    找到原因:shiro.ini必须加在源码包而不是网页下

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-17
      • 2015-01-10
      • 2014-11-15
      相关资源
      最近更新 更多