mybatis 配置文件报错:"Referenced file contains errors(file:/D:/config/ mybatis-3-mapper.dtd).

来源:互联网 发布:淘宝小美工作室假货吗 编辑:程序博客网 时间:2024/06/11 23:52

在项目搭建过程中,配置Mybatis配置文件时,出现错误:在UserMapper.xml头文件出现  "Referenced file contains errors(file:/D:/config/mybatis-3-mapper.dtd). For more information, right click on the message in the Problems View and select "Show Details..." 的问题????


      对于这个问题,出现问题的mapper.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">
可能是由于我自己使用的Mybatis的config配置文件—— mybatis-3-mapper.dtd文件版本较低,当我更换一个高版本的mybatis-3-mapper.dtd文件后,在Eclipse中重新加载mybatis-3-mapper.dtd文件,在通过"Project ---> clear"项目后,错误消失,问题得以解决。


单击add

一般这个时候就好了,如果还没有好,到Project下,点击clear




这时候保存文件即可。
另外,也可以

将 
"http://mybatis.org/dtd/mybatis-3-config.dtd"> 
修改为 

"http://www.mybatis.org/dtd/mybatis-3-config.dtd">


两个配置文件下载:
http://download.csdn.net/download/qq_25927221/9379957

阅读全文
0 0
原创粉丝点击