Take the 2-minute tour ×

I'm extremely new to Hibernate. I posted a question before and it turns out the actual tutorial has bugs in it. But I thought I had straightened those things out. Anyway I am this part of the tutorial. When I do everything as it states before and get up to this point where you execute the line of code that says:


When I run that in cmd prompt inside of the correct folder: in my scenario the root folder is called test. I get the following error:

No suitable driver found for jdbc:hsqldb:mem:testdb

I am using only Maven and Hibernate. I am not using any IDE for this either. If I dont already have a db is one created for me?

Apparently no driver is found for the hsqldb which doesn't make sense to me.

I've included a ss enter image description here enter image description here

Edit: Included the pom.xml http://www.jamesendres.com/pom.xml

Edit 2: Included the entire project http://www.jamesendres.com/test.rar

share|improve this question
can you add an -X argument to mvn exec and make sure the classpath contains the hsql jar. –  gkamal Dec 22 '11 at 5:16
The classpath line is not visible. Can you update your question with the pom.xml and / or output of mvn dependency:tree –  gkamal Dec 22 '11 at 16:03
@gkamal Just added the pom.xml. I'm not too familiar with mvn but I'll look for the output of the dependency:tree –  meepz Dec 22 '11 at 16:08
Can you try running with -Dexec.classpathScope=runtime. Also verify if the hsqldb jar is fine - the jar will be under user.home/.m2/repository/hsqldb/hsqldb/ –  gkamal Dec 22 '11 at 16:15
Yeah hsqldb is in the folder you specified but I still get the error. I edited my post to include the link to my entire project. –  meepz Dec 22 '11 at 19:41

2 Answers 2

One possibility is the hsqldb is a plugin dependency and not a project dependency. If so, you can either change the dependency appropriately or pass an additional argument -Dexec.includePluginDependencies=true to mvn exec:java.

share|improve this answer
I tried that and I still get the same error. I asked a friend and they said "you need to specify the driver for hibernate somewhere. probably a hibernate.properties file or a persistence.xml." –  meepz Dec 22 '11 at 16:02

You have register the driver when you use HSQL. See http://stackoverflow.com/a/2262136/51782 or http://www.willamaze.eu/2009/02/running-hsqldb-in-process-no-suitable-driver-found/.

share|improve this answer
Is there any way to have Maven do this? I don't understand why the tutorial would have us do something outside of the scope of the tutorial. I also actually did try to add the try catch to the EventManager.java file but I still had no luck. –  meepz Dec 23 '11 at 0:17
The suggested code change is to add Class.forName("org.hsqldb.jdbcDriver"); and not the try-catch block. And no, Maven won't do this for you. As for why the tutorial doesn't do this already -- I don't know. As you mentioned in the post you've had to resolve other bugs in the tutorial. You could try posting to Hibernate's own user forum (forum.hibernate.org) –  Sri Sankaran Dec 23 '11 at 11:30

Your Answer


