admin管理员组文章数量:1794759
Consider defining a bean named 'authenticator' in your configuration.
SpringBoot整合Shiro时出错 错误: 2018-10-31 15:49:38.697 ERROR --- [restartedMain] o.s.b.d.LoggingFailureAnalysisReporter: *************************** APPLICATION FAILED TO START *************************** Description: Parameter 0 of method authorizationAttributeSourceAdvisor in com.csair.etm.manage.configuration.ShiroConfiguration required a bean named 'authenticator' that could not be found. Action: Consider defining a bean named 'authenticator' in your configuration. <!--之前用的依赖--> <!--Shiro--> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-spring</artifactId> <version>1.4.0</version> </dependency> <!--上面这样没报错,换成下面的依赖就报错了--> <!--shiro--> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-spring-boot-web-starter</artifactId> <version>1.4.0</version> </dependency> 原因:
在starter的org.apache.shiro.spring.config.web.autoconfigure类已经定义了securityManager,代码如下:
@Bean @ConditionalOnMissingBean protected SessionsSecurityManager securityManager(List<Realm> realms) { return super.securityManager(realms); }所以把注入的securityManager类型换成SessionSecurityManager就可以了
本文标签: namedbeandefiningampconfiguration
版权声明:本文标题:Consider defining a bean named &#039;authenticator&#039; in your configuration. 内容由林淑君副主任自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.xiehuijuan.com/baike/1686549980a80747.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论