Element type “property” must be declared.
新手一枚。。。。被这个错误卡了半天
看下我的xml文件
```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" >
<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/two</property>
<property name="connection.username"></property>
<property name="connection.password"></property>
<!-- 描述映射文件的保存路径 -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<mapping class="oto2.Student" />
<mapping class="oto2.IdCard" />
</session-factory>
</hibernate-configuration>
然后就从头到尾开始报
Element type “XXXXX” must be declared.错误
最后百度半天都是一些没啥大用的解决方法、
最后我把xml头文件的5.0 改成 了3.0.
具体原因我也不太清楚 不过总算能继续往下写了
希望对你们有点帮助。