spring boot开发 @autowired注入失败

@autowired注入失败 会出现如下错误提示:

2018-05-28 08:39:41.857  INFO 8080 --- [  restartedMain] org.hibernate.Version                    : HHH000412: Hibernate Core {5.2.17.Final}
2018-05-28 08:39:41.859  INFO 8080 --- [  restartedMain] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
2018-05-28 08:39:41.988  INFO 8080 --- [  restartedMain] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2018-05-28 08:39:42.143  INFO 8080 --- [  restartedMain] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
2018-05-28 08:39:42.288  INFO 8080 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2018-05-28 08:39:42.561  WARN 8080 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'BController': Unsatisfied dependency expressed through field 'supplierService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.nenu.service.SupplierService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2018-05-28 08:39:42.561  INFO 8080 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2018-05-28 08:39:42.562  INFO 8080 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated... 2018-05-28 08:39:42.566 INFO 8080 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. 2018-05-28 08:39:42.568 INFO 8080 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2018-05-28 08:39:42.580 INFO 8080 --- [ restartedMain] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2018-05-28 08:39:42.718 ERROR 8080 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: Field supplierService in com.nenu.controller.BController required a bean of type 'com.nenu.service.SupplierService' that could not be found. Action: Consider defining a bean of type 'com.nenu.service.SupplierService' in your configuration.

 

 

修改:

SupplierServiceImpl 没有添加@service注入

 参考链接:https://blog.csdn.net/chengdu456/article/details/39504057

转载于:https://www.cnblogs.com/lick468/p/9098447.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值