【问题标题】:not able to autowire in spring boot无法在弹簧靴中自动装配
【发布时间】:2017-10-04 22:50:34
【问题描述】:
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-05-06 20:50:51.844 ERROR 2264 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Field petRepo in com.pet.controller.PetController required a bean of type 'com.pet.repository.PetRepository' that could not be found.


Action:

Consider defining a bean of type 'com.pet.repository.PetRepository' in your configuration.

【问题讨论】:

  • 你能发布你的 PetController 和 PetRepository 代码吗?

标签: spring spring-boot autowired


【解决方案1】:

尝试将 @Repository 注释添加到您的 repo 类中

   @Repository
    public interface PetRepository <T,ID extends Serializable> extends CrudRepository{
}

【讨论】:

    猜你喜欢
    • 2016-09-27
    • 1970-01-01
    • 2017-12-21
    • 2018-02-16
    • 2014-08-30
    • 1970-01-01
    • 1970-01-01
    • 2017-12-22
    • 1970-01-01
    相关资源
    最近更新 更多