Interface:
public interface registration service
Implementation Class:
@Service
public class RegistrationServiceImpl implements RegistrationService{
@Autowired
RegistrationService registrationService;}
Inside Controller Class:
@Autowired
private RegistrationService registrationService;
Hi guys, would like to get a better understanding regarding to service and autowired annotation. Currently, I am placing the Service annotation in the Implementation class, but when I try to use the Autowired annotation in my controller class, I am still getting this error
'sample.RegistrationService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}\"}}"
May I know why and what would be the solution for it?
Directory of Service:
Sample.service.Registration
Directory of Controller:
Sample.controller.registrationController
EDIT for the correct way of implementation: