mapper.xml을 작성 할때 추가하지 않아서 톰캣 실행시 오류가 뜬다.
servlet-context.xml 에 경로를 설정 하더라도 경로를 찾지 못해서
주소 앞에 * 추가 -> 경로는 찾는다 !
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> | |
<property name="dataSource" ref="dataSource" /> | |
<property name="mapperLocations"> | |
<list> | |
<value>classpath:/com/tistory/luahius/service/LibraryMapper.xml</value> | |
</list> | |
</property> | |
</bean> | |
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> | |
<property name="dataSource" ref="dataSource" /> | |
<property name="mapperLocations"> | |
<list> | |
<value>classpath:*/com/tistory/luahius/service/LibraryMapper.xml</value> | |
</list> | |
</property> | |
</bean> |
하지만 mapper가 제역할을 하지 못하고 오류를 내뱉는다.
Mapped Statements collection does not contain value for ...
매퍼의 id가 다를때, Parameter와 bean의 필드 명이 다를때,
mapper.xml namespace와 DAO에서 호출하는 namespace가 다를때,
매퍼가 없거나 스펠링이 틀릴때 뜨는거라는데(참고)
이유는 요것 을 빼놓아서...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
만들때 잘 만들자 빼놓지 말고
'프로그래밍 > 오류' 카테고리의 다른 글
컬럼의 타입과 입력되는 타입이 다를경우 (0) | 2017.02.06 |
---|---|
[Spring] mybatis 서로다른 변수명 오류 (0) | 2017.01.06 |
[JAVA] 한글 깨짐 (0) | 2016.12.20 |