techbeast16
techbeast16

Reputation: 31

org.hibernate.cfg.Environment - hibernate.properties not found

I am working on a project which uses GWT on client side, Tomcat Apache server, MySQL, Hibernate with JPA. I am also using annotations and EntityManager My folder structure is as follows:

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

I am getting following output in the console among other info

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

I also tried placing persistence.xml inside web-inf/meta-inf but I still get same error. This is happening only when I operate it on server. If I test it locally using a main class, it works. Any idea why it can not find properties file

Upvotes: 3

Views: 18315

Answers (1)

WeMakeSoftware
WeMakeSoftware

Reputation: 9162

Hibernate just informs you that it wasn't able to find file named hibernate.properties. If you would like to get rid of this log message create webcontent/WEB-INF/hibernate.properties

You can provide vendor specific properties in the persistence.xml directly like this :

<properties>
 <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
</properties>

Upvotes: 3

Related Questions