org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean…
- User
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'newsServiceImpl': Unsatisfied dependency expressed through field 'newsMapper';
- Assistant
This error occurs when Spring is unable to satisfy the dependency of a bean. In this case, it is unable to create the
newsServiceImplbean because it is missing a dependency expressed through thenewsMapperfield.To resolve this issue, you need to ensure that the
newsMapperbean is properly configured and available for injection. Here are some possible causes and solutions:-
Missing
@Repositoryor@Mapperannotation: IfnewsMapperis a MyBatis mapper interface, make sure it is properly annotated with . If it is a Spring Data JPA repository interface, make sure it has the annotation.
-