2

I'm having problems adding a jdbc driver when creating an Ontop virtual SPARQL repository. I follow the instructions here. The interface already warns that there is no JDBC driver found in the classpath. There is also a link to the download site where you can get the drivers. That all works. But adding the driver to the lib path (in the case of a Linux installation \opt\graphdb-free\app\lib) and then restarting GraphDB does not work. GraphDB is still reporting that the driver is not found.

I did try a lot of things. Adding the correct .jar to the CLASSPATH did not work. Using several other potential lib directories (the instructions are not precise on which directory to choose) also changed nothing. Then I took a look in the files you can create under Help - System Information - New Report. I found that all the .jar files in \opt\graphdb-free\app\lib were 'registered' (don't know if that is the correct term), but not the new one I placed there.

Tried adding other .jars (for MS SQL, next to the MySQL that I needed). Same problem. Then I tried something weird that actually worked. I renamed a .jar that I thought I wouldn't need to .backup and then renamed the mysql driver .jar to that original .jar (hope this is not to confusing). Restarted Grapdb and it worked!

What am I missing here? Is the list of .jars that are in the lib directory hardcoded somewhere? Very curious how to configure this the right way.

NewMarc
  • 86
  • 6

2 Answers2

1

There is a config file, named graphdb-free.cfg, within graphdb-free/appfolder. Open it and alter the app.classpath property by adding the additional jar(s) for the JDBC driver to the list. Save and restart

Damyan Ognyanov
  • 791
  • 3
  • 7
  • This works fine. Thanks a lot! Do you also happen to know where this configuration is done with a OSX install? – NewMarc Mar 15 '21 at 08:43
  • Should be very simmilar - the config file is named `GraphDB Free.cfg` and must be located in the same folder where the `lib` folder (where you place the additional JDBC jars) is stored ... can't be more specific, I've never touched osx ... – Damyan Ognyanov Mar 15 '21 at 09:54
  • 1
    Found it, thanks! When you use search on OSX, the config file will not be found, because it is 'inside' the application contents. Location is: `/Applications/GraphDB Free.app/Contents/Java/`. In there is the same `GraphDB Free.cfg`. – NewMarc Mar 15 '21 at 11:27
1

For docker-install and posterity, the right directory is /opt/graphdb/dist/lib and you may add this line in your Dockerfile : COPY /driver-jdbc-postgresql/jdbc-driver.jar /opt/graphdb/dist/lib