这是因为在Myeclipe中没有关联相应的dtd文件的原因
解决方案:
在hibernate的配置文件中和映射文件中都有
相应的dtd路径
配置文件:
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
映射文件:
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
然后通过
window->preferences->Myeclipse->Files and Editors->xml->xml catalog->user Specified Entried 然后add
打开hibernate源代码中找到相应的dtd文件,导入进来之后
在type一定要选URI
key就将hibernate配置文件中的dtd文件粘上去就可以了。
关闭配置文件,重启相应的配置文件就可以了!!
其他框架如果在配置xml时没有提示的话解决方法类似!!!
一般都是在myeclipse中反转生成的。