Posted on 2007-12-09 15:08
Exiler 閱讀(8549)
評論(4) 編輯 收藏
類似Hibernate異常:
%%%% Error Creating SessionFactory %%%%
org.hibernate.MappingException: Could not read mappings from resource:
這種錯誤出現的情況只有在人為改動了Hibernate生成的文件的時候出現。
情況有兩種
1:hibernate.cfg.xml中,屬性<mapping resource="./Permission.hbm.xml" />里面"./Permission.hbm.xml"所指定的路徑不正確,即改動了生成實體的配置文件的位置。
2:Permission.hbm.xml中,<class name="db_DAO.Permission" table="ACEGI_PERMISSION" schema="POSTTEST">其中屬性class name="db_DAO.Permission"指定的Permission類名錯誤,即:改動了生成實體類的類名或者包名。
如果上述兩種情況改動后仍然報錯,clean一下項目后OK