zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    Redis做为缓存的几个问题
    Python——操作smb文件服务器(上传和下载)
    Python——assert、isinstance的用法
    centos7-修改默认python为3
    mqtt
    如何编译生成 mkfs.ubifs、ubinize 工具
    2020-2笔记
    2020-1笔记
    C语言中getopt()和getopt_long()函数的用法
    buildroot
  • 原文地址:https://www.cnblogs.com/lick468/p/9098447.html
Copyright © 2011-2022 走看看