日期:2014-05-20  浏览次数:20808 次

org.xml.sax.SAXParseException: Document root element "hibernate-AnnotationConfig
org.xml.sax.SAXParseException: Document root element "hibernate-AnnotationConfiguration", must match DOCTYPE root "hibernate-configuration".

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">

<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-AnnotationConfiguration>

  <session-factory>



求高人赐教!!!!

------解决方案--------------------
Document root element "hibernate-AnnotationConfiguration", must match DOCTYPE root "hibernate-configuration".

 这样试试。
 <hibernate-AnnotationConfiguration>
<hibernate-configuration>

</hibernate-configuration>
 </hibernate-AnnotationConfiguration>