Error parsing Mapper XML. Cause: java.lang.NullPointerException

异常org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname's... 异常

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [D:\soft\apache-tomcat-7.0.57-windows-x64\apache-tomcat-7.0.57\webapps\springmvc6\WEB-INF\classes\spring\applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\soft\apache-tomcat-7.0.57-windows-x64\apache-tomcat-7.0.57\webapps\springmvc6\WEB-INF\classes\com\test\dao\IContactsInfoMapper.xml]'; nested exception is java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.NullPointerException
xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap>
<typeAlias alias="User" type="ibatis.model.User" />
<select id="selContactsInfo" resultClass="User">
select *
from users
</select>
</sqlMap>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.test.dao" />
</bean>
什么问题求解 谢谢!
展开
 我来答
百度网友970f162
推荐于2017-06-20 · TA获得超过2391个赞
知道小有建树答主
回答量:628
采纳率:75%
帮助的人:190万
展开全部
springmvc与mybatis整合出现的异常:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userHandler': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImp': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [G:\tomcat\apache-tomcat-7.0.57\webapps\springmvc_mybatis\WEB-INF\classes\com\tanghaibin\mapper\UserMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.NullPointerException
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [G:\tomcat\apache-tomcat-7.0.57\webapps\springmvc_mybatis\WEB-INF\classes\com\tanghaibin\mapper\UserMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.NullPointerException

解决:
mapper配置文件中的namespace没有填;而且namespase的值应该填为:mapper的权限定名;否则还是会抛出异常
wqf琼哲
2015-02-03 · TA获得超过290个赞
知道小有建树答主
回答量:309
采纳率:100%
帮助的人:55万
展开全部
看看配置文件是否注入service?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
匿名用户
2014-12-27
展开全部
配置文件有不对的地方,检查下
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 2条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式