处理指令必须以目标名称开头。

来源:2-6 逐层完成SSM的各项配置

Sulong

2019-06-01

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [spring/spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [D:\javaweb\oto\target\classes\mapper\AreaDao.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 3; 处理指令必须以目标名称开头。

写回答

1回答

翔仔

2019-06-02

同学好,应该是AreaDao.xml里面有些标签或者语法写错了,请与视频仔细检查下,出现错误后导致解析不了。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://www.mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.imooc.o2o.dao.AreaDao">
	<select id="queryArea" resultType="com.imooc.o2o.entity.Area">
		SELECT area_id,area_name,priority,create_time,last_edit_time
		FROM tb_area
		ORDER BY priority DESC
	</select>

</mapper>


0
2
翔仔
回复
Sulong
赞同学的分享能力,多多分享,可以培养沟通和描述事情的能力 加油
2019-06-03
共2条回复

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5113 学习 · 8144 问题

查看课程