SpringBoot报错:Error creating bean with name ‘shopsController‘

Error message:

  • Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'shopsController': Unsatisfied dependency expressed through field 'shopService'; probably means that the dependency cannot be found and the dependency is missing.

Solution:

1. First check whether the annotation on the Service layer class has been added or is wrong. It should be @Service, whether the annotation refers to the Spring class, do not import it into another package, and see the path of the package.

2. Also, if the Service layer is divided into interface and implementation class, check if the implementation class is annotated (@Service), and see if there is any implementation class.

I just missed the @Service annotation in the SeviceImpl implementation class.

 

Guess you like

Origin blog.csdn.net/kking_Ran/article/details/127355473