这是什么错怎么解决啊???!!!

Description:

Field userDetailsService in com.dunan.zzjg.config.WebSecurityConfig required a bean of type 'org.springframework.security.core.userdetails.UserDetailsService' that could not be found.

The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)

The following candidates were found but could not be injected:
- Bean method 'inMemoryUserDetailsManager' in 'UserDetailsServiceAutoConfiguration' not loaded because @ConditionalOnMissingBean (types: org.springframework.security.authentication.AuthenticationManager,org.springframework.security.authentication.AuthenticationProvider,org.springframework.security.core.userdetails.UserDetailsService; SearchStrategy: all) found beans of type 'org.springframework.security.authentication.AuthenticationManager' authenticationManager

Action:

Consider revisiting the entries above or defining a bean of type 'org.springframework.security.core.userdetails.UserDetailsService' in your configuration.

Process finished with exit code 1

2个回答

对象没有注入,仔细检查你的代码 。

weixin_43899041
玄月二十八 搞定了老哥,他记错了,svn代码是错的,多了一个注入,
一年多之前 回复
qyg_java
qyg_java 回复weixin_43899041: 原因可能有很多:环境,版本,工具,项目没有build 等等
一年多之前 回复
weixin_43899041
玄月二十八 老哥就是我同事的都能运行,我把他的单独拉到我电脑上,就不行了,是我本地环境问题?
一年多之前 回复

检查你的基础bean是否有创建,或者类型是否正确

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐