Consider defining a bean of type 'service' in your configuration [Spring boot]

前端 未结 13 1503
伪装坚强ぢ
伪装坚强ぢ 2020-12-10 01:35

I get error when I run the main class.

Error:

Action:
Consider defining a bean of type \'seconds47.service.TopicService\' in your c         


        
13条回答
  •  温柔的废话
    2020-12-10 01:43

    Consider defining a bean of type 'moviecruser.repository.MovieRepository' in your configuration.

    This type of issue will generate if you did not add correct dependency. Its the same issue I faced but after I found my JPA dependency is not working correctly, so make sure that first dependency is correct or not.

    For example:-

    The dependency I used:

        
           org.springframework.data      
           spring-data-jpa
        
    

    Description (got this exception):-

    Parameter 0 of constructor in moviecruser.serviceImple.MovieServiceImpl required a bean of type 'moviecruser.repository.MovieRepository' that could not be found.

    Action:

    After change dependency:-

        
         
     
    热议问题