I’m currently trying to add persistence to my openHab installation. It’s using the official docker image, with mounted /openhab/conf and /openhab/addons directories.
Unfortunately I’m not successful. After trying several hours with jdbc (following http://docs.openhab.org/addons/persistence/jdbc/readme.html) and not even getting a single log entry or database table, I now tried to use jpa. This way obviously at least the config is respected.
Following the description at http://docs.openhab.org/addons/persistence/jpa/readme.html, I put the postgresql driver file postgresql-9.4-1206-jdbc41.jar to /openhab/addons.
Once this file is placed there, openhab complains at startup with an OSGi exception:
2017-10-13 12:03:07.414 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/openhab/addons/postgresql-9.4-1206-jdbc41.jar org.osgi.framework.BundleException: Could not resolve module: org.postgresql.jdbc41  Unresolved requirement: Import-Package: javax.sql at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:] at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:392)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1253)[4:org.apache.felix.fileinstall:3.5.6] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1225)[4:org.apache.felix.fileinstall:3.5.6] at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512)[4:org.apache.felix.fileinstall:3.5.6] at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)[4:org.apache.felix.fileinstall:3.5.6] at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)[4:org.apache.felix.fileinstall:3.5.6]
During startup there are several jpa related error messages so I assume in the jpa way at least the config is respected and I hope that I just have to solve that OSGi Bundle problem.
Unfortunately I’m not used to OSGi so I’m not sure how to get javax.sql to the classpath (or some OSGi Context?!) Does anyone have an idea how I get this working?