[Spring] Error creating bean with name 'sqlSessionFactory'

0후·2021년 5월 14일
0

에러모음

목록 보기
6/9

ERROR

ERROR: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:/sqlmap/*/_SQL.xml]: class path resource [sqlmap/] cannot be resolved to URL because it does not exist

해결 방안

클래스패스 자료들이 [classpath:/sqlmap/**/*_SQL.xml] URL에 존재하지 않는다는 에러로서 [classpath*:/sqlmap/**/*_SQL.xml]로 *을 추가하여 복수개의 파일을 전부 찾아주면 에러가 발생하지 않는다.

profile
휘발방지

0개의 댓글