我想用Spring Security创建身份验证!我有这个错误
应用程序无法启动 说明:我想用Spring Security创建身份验证!我有这个错误,spring,spring-boot,Spring,Spring Boot,应用程序无法启动 说明: Field userService in com.rizomm.filemanager.server.controllers.AuthenticationController required a bean of type 'com.rizomm.filemanager.business.services.UserService' that could not be found. The injection point has the following annota
Field userService in com.rizomm.filemanager.server.controllers.AuthenticationController required a bean of type 'com.rizomm.filemanager.business.services.UserService' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.rizomm.filemanager.business.services.UserService' in your configuration.
您是否用
@Component
注释了com.rizomm.filemanager.business.services.UserService
类?没有,为什么?我用@Service注释@Service
也可以。你能上主课吗?这可能是包扫描问题。@SpringBootApplication(scanBasePackages={“com.rizomm.filemanager”})@ComponentScan(value={“com.rizomm.filemanager”})公共类文件管理应用程序{public static void main(String[]args){SpringApplication.run(FilemanagerApplication.class,args);}