Skip to content
Advertisement

Getting error while using @Autowired in the springboot

I am creating a Springboot project in which I have two service interfaces whom I am injecting in my Controller

StudentService

JavaScript

TeacherService

JavaScript

When I am using @Autowired for the StudentService it is working fine but I am getting an error when I am using @Autowired for the TeacherService in my Controller.I try alot but did not find the cause of the error.

My Controllers

JavaScript
JavaScript

Advertisement

Answer

This type of error generally happens when you might have not used @Service at your Service implementation or The service interface has not been implemented yet. So be sure that you have implemented your Service interface and it should be annotated with @Service.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement