首页 新闻 赞助 找找看

springboot在controller中使用autowired注解导致工程启动失败,但是在dao和service里面使用却不会导致工程无法启动

0
[待解决问题]

springboot在controller中使用autowired注解导致工程启动失败,但是在dao和service里面使用却不会导致工程无法启动

 

 

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tempControllor': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.templates.service.UserService com.templates.controller.TempControllor.userService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.templates.service.UserService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

问题补充:

shinibei1的主页 shinibei1 | 菜鸟二级 | 园豆:204
提问于:2017-05-01 11:15
< >
分享
所有回答(3)
0

补充service的截图

shinibei1 | 园豆:204 (菜鸟二级) | 2017-05-01 11:20
0

试一下给service指定名称

狼爷 | 园豆:1204 (小虾三级) | 2017-05-01 22:16
0

TempController截图贴一下啊!?

SpringRen | 园豆:412 (菜鸟二级) | 2017-05-02 10:03
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册