This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes hibernate.properties not being found?  Harnessing Hibernate Chapter 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "hibernate.properties not being found?  Harnessing Hibernate Chapter 2" Watch "hibernate.properties not being found?  Harnessing Hibernate Chapter 2" New topic
Author

hibernate.properties not being found? Harnessing Hibernate Chapter 2

Andrew Leer
Ranch Hand

Joined: Nov 11, 2003
Posts: 44
I'm reading Chapter 2 of Harnessing Hibernate, and when generating my db schema, I get an error that a hibernate dialect has not been set.


Project Structure


The Build Error


relevant sections of build.xml

I have my hibernate.properties file in my src (${source.root}) directory, and it is copied over to the classes (${class.root}) directory in the dependent prepare <target> before the schema <target> is run.

It appears to me that hibernate.properties is not being found by hbm2ddl.

Should I be placing this file elsewhere?

I've also downloaded the examples and ended up with the same error, however the example does not appear to come with a hibernate.properties file, so that would be expected.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3838

I don't have the book. But what is the strategy used to bootstrap the Hibernate? Is not defined a hibernate.cfg.xml file? If it reads from a properties file then how?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Andrew Leer
Ranch Hand

Joined: Nov 11, 2003
Posts: 44
Hello and thank you for responding.

I did a diff with the files that came with the book (after I found them) and discovered I had mis-typed a few lines...there's probably nothing to bootstrap it, as in Chapter 2 we are just generating the Java source classes from an .hbm.xml file and also generating the ddl schema for the database.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hibernate.properties not being found? Harnessing Hibernate Chapter 2