java - Netbeans 8.0.1 找不到 shiro.ini

标签 java netbeans glassfish shiro

我在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.

您知道原因是什么或如何解决吗?

最佳答案

不一定,

扩展 ResourceBasedWebEnvironment

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

关于java - Netbeans 8.0.1 找不到 shiro.ini,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31804499/

相关文章:

java - 运行简单 EJB 应用程序时出现问题

java - 尽管我正在声明布局管理器,但为什么没有调用 paintComponent(Graphics)

java - 如何在图像周围创建边框而不是在 JLabel 周围创建边框?

java - chrome 中的 Jquery html() 编码错误

c++ - 无法解析标识符 constexpr

java - 在 Matisse 中更改组件的类型

java - 从文件系统查看 Eclipse Run As 配置

java - NetBeans + Microsoft SQL Server 2012 jbdc 驱动程序

eclipse - 无法使用 Tomcat 或 GlassFish 服务器从 Java Jersey 应用程序获取 JSON 响应

java - 后端的 CDI?