강의

멘토링

로드맵

인프런 커뮤니티 질문&답변

User Unknown님의 프로필 이미지
User Unknown

작성한 질문수

자바 스프링부트 활용 웹개발 실무용

E02 lombok설치 + Mybatis 설정 + 간단한 게시판 Api 구현

2강에 setMapperLocations 에 에러

작성

·

803

0

The method setMapperLocations(Resource[]) in the type SqlSessionFactoryBean is not applicable for the arguments (Resource); 는 어떻게 해결 하나요?

퀴즈

What are the main advantages of managing common configuration values in a specific class (such as @GlobalConfig)?

Application performance improves dramatically

Easy management and modification of settings increases maintainability.

Configuration values can be retrieved without a DB connection.

The configuration difference between development and production environments completely disappears.

답변 1

1

송자바코딩님의 프로필 이미지
송자바코딩
지식공유자

import org.springframework.core.io.support.PathMatchingResourcePatternResolver;

 

factory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mybatis/sql/*.xml"))

 

이렇게 사용하시면 오류가 해결되실거에요.

User Unknown님의 프로필 이미지
User Unknown
질문자

감사합니다

User Unknown님의 프로필 이미지
User Unknown

작성한 질문수

질문하기