2014-09-24 45 views
0

我在我的vaadin項目中使用hibernate 4.3.6。 每次我對源代碼進行更改時,都希望應用程序再次生成,新的源代碼會自動部署到Tomcat。換句話說,Tomcat應該重新加載它的上下文。部署期間休眠異常

的問題是,在這個操作休眠拋出一個錯誤:

GRAVE: Exception loading sessions from persistent storage 
org.hibernate.HibernateException: registry does not contain entity manager factory: myproject 
at org.hibernate.jpa.internal.EntityManagerFactoryRegistry.getNamedEntityManagerFactory 
(...) 

該日誌後,我得到:

24/09/2014 13:14:43 org.apache.catalina.core.StandardContext reload 
INFO: Reloading Context with name [/myproject] is completed 

但是,我不能繼續使用該網站,因爲我收到了表示會話丟失的消息。

我的問題是:什麼是這個休眠異常,我該如何解決它?

編輯: 此錯誤只有當我在會議上存儲一個JPA實體,例如發生:登錄用戶

+0

如果你停止並重新啓動tomcat,錯誤仍然出現? – 2014-09-24 16:48:06

+0

不,它工作正常 – guilhermecgs 2014-09-24 16:48:36

+0

您是否在使用或不使用JPA的情況下使用hibernate?你的項目使用什麼版本的vaadin? – 2014-09-24 16:48:42

回答

2

我不知道任何方式得到你想要的東西,在Tomcat中,除了與JRebel的。 Vaadin的工作人員使用和推薦。鏈接有關Vaadin + JRebel的有趣的信息:http://zeroturnaround.com/blog/jrebel-case-study-vaadin-eliminates-redeploys-and-saves-10-of-development-time/

如果你決定使用碼頭,而不是Tomcat,則可以進行設置,讓應用程序的動態重新加載的建議未來這裏:https://blog.oio.de/2012/08/23/dynamic-reloading-of-vaadin-applications-with-maven-and-eclipse/