sqlSessionFactory빈 생성 에러

eclipse+sping+maven+tomcat7 plugin, tomcat7:run goal 실행시 다음과 같은 에러가 발생하였다.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [D:\projects\luna_projects\javada_bbs\target\classes\javada\spring\context-datasource.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [javada/sqlmap/mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource /javada/sqlmap/board/board.xml 
[... 이하생략...]
Caused by: org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [javada/sqlmap/mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource /javada/sqlmap/board/board.xml
[... 이하생략...]
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource /javada/sqlmap/board/board.xml
[... 이하생략...]
Caused by: java.io.IOException: Could not find resource /javada/sqlmap/board/board.xml
[... 이하생략...]

 

mapper

 

mybatis-config.xml, 8번째 라인의 javada앞에 “/”가 있었을때 에러 발생, 제거하니 상기의 에러 메세지가 사라짐.

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" 
"http://mybatis.org/dtd/mybatis-3-config.dtd"> 
<configuration> 
<mappers> 
  <mapper resource="javada/sqlmap/board/board.xml"/> 
  <mapper resource="javada/sqlmap/cache/cache.xml"/> 
  <mapper resource="javada/sqlmap/code/code.xml"/> 
  <mapper resource="javada/sqlmap/stock/stock.xml"/> 
</mappers>
</configuration>

댓글 남기기

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다