2011-01-21 25 views
3

我正在這在客戶端使用GWT項目,Tomcat的Apache服務器,MySQL和Hibernate的JPA的。我還使用註釋和EntityManager的 我的文件夾結構如下:org.hibernate.cfg.Environment中 - 不是的hibernate.properties發現

+build 
+java 
    +com 
    +META-INF 
     persistence.xml 
+webcontent 
    +WEB-INF 

我得到以下以及其他信息在控制檯輸出

INFO org.hibernate.cfg.Environment - hibernate.properties not found 
INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist 

我也試圖把裏面的persistence.xml web的inf/meta-inf,但我仍然得到相同的錯誤。 當我在服務器上運行它這只是發生。如果我使用主類在本地進行測試,它就可以工作。 任何想法爲什麼它不能找到屬性文件

+0

你有沒有嘗試`webcontent/META-INF/persistence.xml`? – 2011-01-21 03:16:10

回答

3

Hibernate只是通知你,它無法找到名爲hibernate.properties的文件。 如果你想擺脫這個日誌消息的創建的WebContent/WEB-INF/hibernate.properties

可以提供特定廠商在persistence.xml直接像這樣的性質:

<properties> 
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" /> 
</properties> 
相關問題