I'm making SpringBoot Project and following some instructions for testing Spring Boot.
While I tried to connect mysql DB with project, service cannot find the mapper.
i don't know why it cannot find the mapper...
@Service
public class TestService {
@Autowired
TestMapper mapper;
public List<TestVo> selectTest(){
return mapper.selectTest();
}
}
this is the service code and
@Repository
@Mapper
public interface TestMapper {
List<TestVo> selectTest();
}
this is the mapper code
the following error is
Field mapper in com.steve.firstBoot.test.service.TestService required a bean of type 'com.steve.firstBoot.test.mapper.TestMapper' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.steve.firstBoot.test.mapper.TestMapper' in your configuration.
I will post the image of my packages setting...
