AnnotationConfigApplicationContext has not been refreshed yet - what's wrong?

前端 未结 3 1685
独厮守ぢ
独厮守ぢ 2021-01-07 19:15

My very basic spring application stopped working and I can\'t understand what\'s happened. pom.xml:


    

        
3条回答
  •  终归单人心
    2021-01-07 19:49

    Just in case someone has a similar issue and can´t relate directly to the example above, this may help:

    I ran into the problem when I had one of my repositories outside of the folder that was included in

    @EnableJpaRepositories(basePackages = {"com.myproject.repositores"})
    

    Which lead to this first exception:

    Description: Field profileRepository in com.myproject.featurepackage.config.ProfileService required a bean of type 'com.myproject.featurepackage.ProfileRepository' that could not be found. The injection point has the following annotations: - @org.springframework.beans.factory.annotation.Autowired(required=true)

    When I afterwards accessed the ApplicationContext to instanciate a bean, I ran into the error

    org.springframework.context.annotation.AnnotationConfigApplicationContext@4983159f has not been refreshed yet

提交回复
热议问题