本文介绍了netbeans 8.0.1无法找到shiro.ini的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

  [main] 
#对象和它们的属性在这里定义,
#比如securityManager,Realms和其他任何
#else需要构建SecurityManager
shiro。 loginUrl = /index.jsp
[users]
root = 12345,admin $ b $ guest = 12345,guest

[角色]
admin = *

[url]
/index.xhtml = authc
/login.xhtml = authc
/info.xhtml = anon
/ logout =注销
/ admin / ** = authc,roles [admin]

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

  SEVERE:[admin-listener(5)] INFO org.apache.shiro.web.env。 EnvironmentLoader  - 启动Shiro环境初始化。 
SEVERE:[admin-listener(5)] ERROR org.apache.shiro.web.env.EnvironmentLoader - Shiro环境初始化失败
SEVERE:org.apache.shiro.config.ConfigurationException:Shiro INI配置要么没有被发现,要么被发现是空的/未配置的。

你是什么原因或如何修复它?
不一定,

IniWebEnvironment class which将 ResourceBasedWebEnvironment 的默认配置位置指定为 /WEB-INF/shiro.ini classpath: shiro.ini


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?

解决方案

Not necessarily,

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

这篇关于netbeans 8.0.1无法找到shiro.ini的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 13:57