无法在春季启动时自动装配

时间:2017-05-06 15:26:22

标签: spring spring-boot autowired

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.

1 个答案:

答案 0 :(得分:0)

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

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