I have attempted working with SQLite and h2 databases, with the sqlite-jdbc-3.20.1.jar /h2-1.4.195.jar in the classpath.
I have the h2 driver jar in my pom.xml, didn't seem to make a difference at runtime.
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.195</version>
</dependency>
I copied the jars to target directory in the hopes that "java -cp target/*" might get these jars right into the class path. All to no avail. I am getting this error that's driving me crazy, it won't tell me what class it didn't find
Causing: java.sql.SQLException: Unable to load class:
from ClassLoader:sun.misc.Launcher$AppClassLoader@18b4aac2;ClassLoader:sun.misc.Launcher$AppClassLoader@18b4aac2
` ... 24 more
...
org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator: HHH000342: Could not obtain connection to query metadata
Caused by: java.lang.ClassNotFoundException: at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at > >org.tomcat.jdbc.pool.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:38)
I have printed the maven tree and used verbose:class option and do find driver class loaded. I have dropwizard-hibernate package in my maven dependencies. OK, any way to coerce this thing to tell me which class it is not able to find?!
Addendum:
My Config.yml
logging: level: INFO loggers: com.srini.testdw: DEBUG database: driverClass: org.h2.Driver user: "sa" password: "" url: jdbc:h2:./testdb properties: charSet: UTF-8 maxWaitForConnection: 1s validationQuery: "/* MyService Health Check */ SELECT 1" minSize: 8 maxSize: 32 checkConnectionWhileIdle: false evictionInterval: 10s minIdleTime: 1 minute hibernate.dialect: org.hibernate.dialect.H2Dialect hibernate.show_sql: true hibernate.generate_statistics: false hibernate.hbm2ddl.auto: validate server: minThreads: 2 maxQueuedRequests: 3 type: simple