spring+mybatis,tomcat启动异常

yangksj
  • 2
新手上路,请多包涵

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>

回复
阅读 2.2k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
你知道吗?

宣传栏