Categories
Software development

Some corrections to Hibernate tutorial

Reading Time: 2 minutes

Hibernate logo
I was referring to the First application at Hibernate (Jboss) offical documentation. I found some problems when doing the exercise: just want to share some of my findings so others may benefit.

1) dependency version missing: there are already some some discussions on the Hibernate discussion forum, such as this one and that one. I followed the first one: added the version numbers as suggested and the problem went away.

2) jdbc driver can not be found, the fix is to

mvn install:install-file -DgroupId=hsqldb -DartifactId=hsqldb -Dversion=1.8.1.2 -Dpackaging=jar -Dfile=/path/to/your/hsqldb.jar

in my case (mac) this is /Users/major_xu/Downloads/hsqldb/lib/hsqldb.jar

I saw discussion on this one, too, the suggestion is to “add classpath for hsqldb.jar”. But I don’t know how to do it in maven command line.

3) misc: there are a lot other corrections: