I’m migrating an Eclipse project from Windows to Mac. For some reason, I’m getting a classpath problem specifically on loading the SQLite JDBC driver in MAC. Windows copy is OK.
Exception in thread "main" org.hibernate.service.classloading.spi.ClassLoadingException: Specified JDBC Driver org.sqlite.JDBC class not found at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:107)
Here’s what I did:
-
Displayed System.getProperty(“java.class.path”) – the result is exactly the same between the PC and MAC. Same JARs and versions being imported, nothing extra nor missing.
-
Initially I was referencing sqlite from the Maven local repository. I took out the actual sqlite-jdbc-3.7.2.jar, moved it into some place and did a direct reference to it in the build path. But the problem remains.
A few observations:
In Windows, typing “org.sqlite.” in the code gives me a bunch of auto-complete options, while in Mac, it does not give anything.
Other JARs seem to be imported just fine (ex. I have a JodaTime jar and it’s working just fine)
Is this a classpath problem, or do I need a Mac distribution of SQLite-JDBC? I don’t see any specific jar on on their site. My current copy was downloaded through Maven dependencies.
Thanks in advance.
The problem is fixed.
I simply replaced my current JAR with a fresh copy from xerial.org, and it worked.
Either the initial JAR I got from the Maven dependency download was corrupted, or some file permissions were preventing the JVM from accessing the JAR’s contents.