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
顶
踩
相关文章:
- (解决) springmvc jsp界面显示乱码 spring+mybatis+my
- java.util.concurrent.ExecutionException: Failed to
- java 通过batik 把svg格式的矢量图生成png图片
- linux debian安装java jdk开发环境
- java 跳出多从循环,跳到指定的循环处
- spring +mybatis 出现The content of elements must c
- java.net.SocketException: No buffer space availabl
- java new file 使用相对路径读取文件
- java.lang.AssertionError 传递对象错误 junit EasyMo
- 7 构建 java开发环境 [java入门教程]