拋出異常: [java] org.hibernate.HibernateException: problem parsing configuration/hibernate.cfg.xml,
[java] Caused by: org.dom4j.DocumentException: Invalid byte 2 of 2-byte UTF-8 sequence. Nested exception: Invalid byte 2 of 2-byte UTF-8 sequence.。
這兩個是同一個問題,xml文件編碼不對。
原因:copy文章裏的代碼保存的時候,因爲有中文,默認保存成了GB2312格式。解決:把hibernate.cfg.xml存成utf-8格式