JavaEE-SSH搭建出現錯誤筆記

1、

No setter found for property *(property)in class *(class)

大概意思是什麼屬性在什麼類中沒有找到。

http://stackoverflow.com/questions/19748013/no-setter-found-for-property-in-class

可以參考這邊文章。

在配置ApplicationConext.xml文件是報這樣的錯誤。

解決的辦法檢查下你的set***是否出現錯誤,如果檢查不出,建議可以把原來方法刪除,通過編輯器自動生成,就是右鍵-source-gennertate set and get

2、

Multiple annotations found at this line:  - DOCTYPE declaration not   closed

錯誤參考http://bbs.csdn.net/topics/220026259

居然剪切然後複製上去可以了,神奇啊。

3、

The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files

使用java jdk1.8 出現的問題。

http://blog.csdn.net/xtj332/article/details/41650779

原因說是1。8版本不穩定

4、log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.

找不到log4j.properties配置文件

http://bbs.csdn.net/topics/320261792

5、在Query query = session.createQuery("from table");

然後調試下,query是爲空的。

原因是createQuery方法拼接有點問題吧,使用其他createSQLQuery替代,就可以了。

百度解決方法:Query query = session.createSQLQuery("from table").addEntity(Student.class);

List<Student> list = query.list();便可以通過遍歷list實現輸出

hibernate中Query query=session.createQuery的問題

hibernate中Query query=session.createQuery的問題

hibernate中Query query=session.createQuery的問題

發佈了37 篇原創文章 · 獲贊 10 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章