As mentioned in the comment on SO, an error occurs when you try to introduce the / autowire implementation class instead of an interface.
bean 'studentService' cannot be entered as 'com.student.service.StudentServiceImpl' because it is a JDK proxy dynamics that implements: com.student.service.StudentService
In the settings sent by SO,
public class StudentServiceImpl implements StudentService { } public interface StudentService { }
If you disable the interface as shown below, you will not receive an error:
@Autowired //or @Inject StudentService studentService;
gtiwari333
source share