Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Spring with Hibernate Integrating Hibernate with Spring Add JPA Annotations to Entities

Nivedita Gautam
Nivedita Gautam
Courses Plus Student 1,737 Points

Cannot load JDBC driver class 'org.h2.Driver'

I am getting this error on bootrun -

Cannot load JDBC driver class 'org.h2.Driver' java.lang.ClassNotFoundException: org.h2.Driver

1 Answer

Kareem Jeiroudi
Kareem Jeiroudi
14,984 Points

First of all, I hope you've resolved the issue by now.

Second, if you haven't, could you please share the entire stacktrace not just the exception name. Also, try let others understand what you were doing so that you got this exception.

Lastly, the first thing that comes to my mind is to make sure that you have

compile 'com.h2database:h2:1.4.199' // dialect

in you build.gradle file. Make sure it's compile not testCompile