인프런 커뮤니티 질문&답변
2강에 setMapperLocations 에 에러
작성
·
803
0
The method setMapperLocations(Resource[]) in the type SqlSessionFactoryBean is not applicable for the arguments (Resource); 는 어떻게 해결 하나요?
퀴즈
공통 설정값을 특정 클래스(@GlobalConfig 등)로 관리할 때 얻을 수 있는 주요 이점은 무엇일까요?
애플리케이션 성능이 비약적으로 향상된다
설정값 관리 및 변경이 용이해 유지보수성이 높아진다
DB 연결 없이 설정값 조회가 가능해진다
개발 환경과 운영 환경 간 설정 차이가 완전히 사라진다
답변 1
1
송자바코딩
지식공유자
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
factory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mybatis/sql/*.xml"))
이렇게 사용하시면 오류가 해결되실거에요.





감사합니다