org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration 解决

最近使用spring+mybatis框架报如下错误:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/conf/applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: ServletContext resource [/WEB-INF/conf/mybatisContext.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource org/test/resources/mybatis/userMapper.xml

发现原因是mybatis的映射org/test/resources/mybatis/userMapper.xml文件没有找到,

出现上述错误一般就是mapper.xml路径没有配置对仔细检查路径:

<mappers>
        <mapper resource="org/test/resources/mybatis/userMapper.xml" /> 
 </mappers>
来源://作者:/更新时间:2013-12-07
相关文章
评论:
验证码:
匿名评论: