巧玩SpringBoot——启动报错“Consider defining a bean named 'authenticator' in your configuration”问题

编程知识 更新时间:2023-05-02 05:33:17

转载请注明出处:http://blog.csdn/dongdong9223/article/details/82875095
本文出自【我是干勾鱼的博客】

Ingredient:

  • Java:Java SE Development Kit 8u162(Oracle Java Archive),Linux下安装JDK修改环境变量

  • Eclipse:Eclipse Neon 3 Packages

  • SpringBoot: SPRING INITIALIZR(Spring Boot)

SpringBoot启动时出现错误:

Parameter 0 of method authorizationAttributeSourceAdvisor in com.example.myproject.login.security.SBShiroConfig required a bean named ‘authenticator’ that could not be found.

Action:

Consider defining a bean named ‘authenticator’ in your configuration.

之前有一篇文章也提到了这个问题,但我这里出现的问题没有据此找到解决办法,仔细注意发现是因为DefaultWebSecurityManager创建问题的错误!在文件:

ShiroConfig.java

中,创建的方法本来应该返回DefaultWebSecurityManager类型:

org.apache.shiro.web.mgt.DefaultWebSecurityManager

的方法,错误的创建成了返回SecurityManager的类型:

org.apache.shiro.mgt.SecurityManager

更多推荐

巧玩SpringBoot——启动报错“Consider defining a bean named 'authenticator' in y

本文发布于:2023-04-26 07:08:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/8ef440944cec0449c1c94d1c4c648455.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:报错   defining   SpringBoot   bean   configuration

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 104640文章数
  • 26216阅读数
  • 0评论数