SpringSecurity3.0.4的Unsupported configuration a...

回眸只為那壹抹淺笑 提交于 2020-04-07 07:55:45
异常信息:

在使用SpringSecurity3.0.4时出现如下异常,
[orm:15:07:17] ERROR [main] ContextLoader.initWebApplicationContext(220) | Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChainProxy': Cannot resolve reference to bean 'filterSecurityInterceptor' while setting bean property 'filterChainMap' with key [/**] with key [9]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterSecurityInterceptor' defined in file [E:\workshop\eclipse_jee\info_platform\target\classes\applicationContext-security.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Unsupported configuration attributes: [数据模块]

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterSecurityInterceptor' defined in file [E:\workshop\eclipse_jee\info_platform\target\classes\applicationContext-security.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Unsupported configuration attributes: [数据模块]

2010-12-02 15:07:17.952:WARN::Failed startup of context org.mortbay.jetty.plugin.Jetty6PluginWebAppContext@a40050{/info_platform,E:\workshop\eclipse_jee\info_platform\src\main\webapp}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChainProxy': Cannot resolve reference to bean 'filterSecurityInterceptor' while setting bean property 'filterChainMap' with key [/**] with key [9]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterSecurityInterceptor' defined in file [E:\workshop\eclipse_jee\info_platform\target\classes\applicationContext-security.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Unsupported configuration attributes: [数据模块]

2010-12-02 15:07:17.952:WARN::Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChainProxy': Cannot resolve reference to bean 'filterSecurityInterceptor' while setting bean property 'filterChainMap' with key [/**] with key [9]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterSecurityInterceptor' defined in file [E:\workshop\eclipse_jee\info_platform\target\classes\applicationContext-security.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Unsupported configuration attributes: [数据模块]:

原因:
原来是SpringSecurity3的配置文件applicationContext-security.xml中已经设置了
“将授权名称的默认前缀由ROLE_改为A_”,这样的话,则配置的权限名称是如下样子的:
A_浏览用户
A_新增用户
A_修改用户
A_删除用户
,而我在数据库中保存配置的权限名称是“浏览用户”,一看就知道是没有加上授权名称的前缀,
所以启动时会报上述错误!!!

解决办法:
将数据库中保存的权限名称前加上“A_”即可!!!

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!