The content of element type "session-factory" must match "(property*,mapping*,(class-cache| collect

配置hibernate.cfg.xml時提示The content of element type "session-factory" must match "(property*,mapping*,(class-cache|  collection-cache)*,event*,listener*)".的錯。

   提示先配置property*元素,再配置mapping*元素,依次類推,仔細檢查下看看你的程序中是否存在配置順序錯亂的情況。

只是因爲在

<hibernate-configuration>


<session-factory>


</session-factory>

</hibernate-configuration>

之間存在元素配置順序的錯誤,只需要按提示將順序調整正確即可。 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章