Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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