OData error: Cannot load JDBC driver class
I was wondering if there is anyone who could help me with my problem. I am trying to create an OData Service on SMP3 fetching data from SQL Server. I followed Marvin Hoffmann's Blog, however, after the service deployment the data set access is giving me the following error:
Cannot load JDBC driver class 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
The sqljdbc4.jar library seems to have been deployed correctly from the pickup folder based on the “sqljdbc4.deploy.ok” file in the .state folder. I noticed the bundle has been marked there as “bundle-id=544”.
After inspection of the log I discovered following:
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver from bundle 547
I tried to undeploy the library by deleting it from the server pickup folder but the file would not disappear from the \work\org.eclipse.virgo.nano.deployer\staging folder and the log contains following error:
org.eclipse.virgo.medic.eventlog.default##anonymous#fs-watcher###Hot un-deploy failed for file 'sqljdbc4.jar'.java.lang.NullPointerException: while trying to invoke the method java.lang.String.equals(java.lang.Object) of a null object returned from org.osgi.framework.Bundle.getSymbolicName()
Any idea what might be causing my issues? Not sure whether it is relevant here but note the different bundle ids. By the way, I checked the jar file and it does contain the referenced class under the path com.microsoft.sqlserver.jdbc.
Here is the log containing deployment first (14:11:06) then triggering the OData service request (14:14:53). - https://www.dropbox.com/l/LMKAvG1WtY1F8dLXq5Aboa
even if the deployment with the standard Microsoft JDBC Driver (sqljdbc4.jar) seems to be ok, when you are deploying it directly to SMP3, it won't work... If you have a look into the SMP3 server log you will find some errors.
Similar to the Oracle case, you have to create an osgi enabled bundle wrapping the SQLServer JDBC driver.
I wrote it down in a new blog post here: