Could not parse mapping document from resource ...

错误原因:主要是我们拷贝配置头文件的时候,我们大意了,没有区别他们。

注意:一个是配置文件的头文件,一个是映射文件的头文件。如下红色部分各自配置就不会报错了。

hibernate.cfg.xml:
<?xml version=
"1.0" encoding="UTF-8" ?>
<!DOCTYPE hibernate-
configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

Event.hbm.xml:
<?xml version="1.0"?>
<!DOCTYPE hibernate-
mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

猜你喜欢

转载自xinjiang.iteye.com/blog/1412226