Exception with Shiro and Maven



我正在尝试将应用程序更改为Maven。我正在使用NetBeans和GlassFish 3.1.2.2。有一个问题我解决不了。我一直在寻找,但没有找到任何解决方案。我的问题出在四郎身上。GlassFish控制台显示:

Grave:java.lang.IllegalArgumentException:配置错误。指定了具有属性[loginUrl]的对象[anyofoles],但未首先定义该对象的类。请首先指定类属性,例如myObject=fully_qualified_class_name,然后定义其他属性。网址:org.apache.shiro.config.ReflectionBuilder.applySingleProperty(ReflectionBuilder.java:361)网址:org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:325)

我的Shiro版本与上一个项目相同:*cas市->1.2.0*shiro核心->1.3.0*shiro web->1.3.0

我的衬衫包含:

[main]
anyofroles.loginUrl = /login.xhtml
# realm to be used
secundaryRealm=com.asesoreslocales.security.SecondaryRealm
anyofroles = com.asesoreslocales.security.AnyRolesAuthorizationFilter
builtInCacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
securityManager.cacheManager = $builtInCacheManager
[users]
[urls]
/mantenimientos/** = anyofroles["administrador,editor"]
/remesas/** = anyofroles["administrador,editor"]
/alegaciones/** = anyofroles["administrador,editor"]
/notificaciones/** = anyofroles["administrador,editor"]
/expedientes/expedientes.xhtml = anyofroles["administrador,editor"]
/expedientes/busquedaExpedientes.xhtml = anyofroles["administrador,editor,consultor"]

在之前的项目中,Shiro工作正常。

谢谢你的帮助,对不起我的英语。

错误消息说您应该首先声明对象:

anyofroles = com.asesoreslocales.security.AnyRolesAuthorizationFilter

然后定义它的属性:

anyofroles.loginUrl = /login.xhtml

你试过了吗?可能是这样的:

[main]
# realm to be used
secundaryRealm=com.asesoreslocales.security.SecondaryRealm
anyofroles = com.asesoreslocales.security.AnyRolesAuthorizationFilter
anyofroles.loginUrl = /login.xhtml
builtInCacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
securityManager.cacheManager = $builtInCacheManager
[users]
[urls]
/mantenimientos/** = anyofroles["administrador,editor"]
/remesas/** = anyofroles["administrador,editor"]
/alegaciones/** = anyofroles["administrador,editor"]
/notificaciones/** = anyofroles["administrador,editor"]
/expedientes/expedientes.xhtml = anyofroles["administrador,editor"]
/expedientes/busquedaExpedientes.xhtml = anyofroles["administrador,editor,consultor"]

最新更新