spring+mybatis,tomcat启动异常
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: ServletContext resource [/WEB-INF/mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.NullPointerException
是映射文件的问题,在mybatis配置文件中去掉映射文件就没有问题
mapper文件:
<mapper>
<resultMap type="../org.gocom.crm.bean.Operator" id="operators">
<result property="userId" column="userid"/>
<result property="userName" column="operatorname"/>
<result property="password" column="password"/>
</resultMap>
<select id="queryOperator" resultType="operators">
<![CDATA[
select userid,operatorname,password from ac_operator where rownum<=10
]]>
</select>
</mapper>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论