2017-10-09 71 views
0

我正在尝试将一个应用程序更改为Maven。 我正在使用NetBeans和GlassFish 3.1.2.2。 存在一个我无法解决的问题。我一直在寻找,我还没有找到任何解决方案。 我的问题是Shiro。 GlassFish控制台显示:Shiro和Maven的例外

严重:java.lang.IllegalArgumentException:配置错误。没有首先定义该对象的类,则指定具有属性[loginUrl]的对象[anyofroles]。请首先指定类属性,例如myObject = fully_qualified_class_name,然后定义其他属性。 在org.apache.shiro.config.ReflectionBuilder.applySingleProperty(ReflectionBuilder.java:361) 在org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:325)

我四郎版本在以前的项目相同: *四郎-CAS - > 1.2.0 *四郎核心 - > 1.3.0 *四郎的Web - > 1.3.0

我shiri.ini包含:

[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正常工作。

感谢您的帮助和对我的英语感到抱歉。

回答

0

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

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"] 
+0

这是......这是非常合情合理的,但是当我试图修复它,我没有想到这一点。我不知道为什么在以前的项目正常工作。非常感谢!! – Hijano

+0

没问题,不客气。乐于帮助。 – funfried