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

转载请注明出处:http://blog.csdn.net/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)