我是靠谱客的博主 忧虑菠萝,这篇文章主要介绍springsecurity报错Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean na,现在分享给大家,希望可以做个参考。
Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named ‘myUserDetailsService’ is expected to be of type ‘cn.edu.sjzc.zc.mvc.config.MyUserDetailsService’ but was actually of type ‘com.sun.proxy.$Proxy31’
原因是使用@Autowired注入的userDetailsService对象是代理对象
使用下面的配置解决
@Bean
public UserDetailsService getUserDetailsService()
{
return new MyUserDetailsService();
}
最后
以上就是忧虑菠萝最近收集整理的关于springsecurity报错Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean na的全部内容,更多相关springsecurity报错Caused内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复