ncwekjn
(First Last)
December 6, 2018, 1:14pm
1
I’m using the JDBC persistence with MariaDB v10:
services/jdbc.cfg
:
url=jdbc:mariadb://my-db-server:3307/openhab
user=openhab
password=password
persistence/jdbc.persist
:
Strategies {
default = everyUpdate
}
Items {
* : strategy = everyChange, restoreOnStartup
}
But I don’t see any JDBC related messages in the log (also tried log:set TRACE org.openhab.persistence.jdbc
in the console, no effect). The MariaDB openhab
database is also empty, no single table there.
How can I check what’s going on with the persistence, if there was an error?
Dim
(Angelos)
December 6, 2018, 1:30pm
2
ncwekjn:
3307
isn’t 3306 the default? (did you change the port that the MariaDB is listening to?)
if the MariaDB is running on locahost:
url=jdbc:mariadb://127.0.0.1:3306/openhab
user=openhab
password=password
ncwekjn
(First Last)
December 6, 2018, 1:31pm
3
3306 is indeed the default, but in my case it’s 3307
. Wouldn’t there be an error message or something if it were wrong?
Dim
(Angelos)
December 6, 2018, 1:32pm
4
from openhab console :
bundle:list -s|grep -i JDBC
ncwekjn
(First Last)
December 6, 2018, 1:35pm
5
openhab> bundle:list -s|grep -i JDBC
230 │ Resolved │ 80 │ 1.3.5.0 │ org.mariadb.jdbc
231 │ Resolved │ 80 │ 1.13.0.M6 │ org.openhab.persistence.jdbc
Dim
(Angelos)
December 6, 2018, 1:37pm
6
the bundles are not Active (not 100% if they should be and if it’s ok to be in state Resolved)
can you try:
bundle:start 230
bundle:start 231
1 Like
ncwekjn
(First Last)
December 6, 2018, 1:39pm
7
Aha, I see now a lot of output in the log, and tables have been created. Why didn’t it start automatically?
Dim
(Angelos)
December 6, 2018, 1:40pm
8
they needed a kick
I have no clue
did you try to restart the OH2 service to see if they come up?
ncwekjn
(First Last)
December 6, 2018, 1:41pm
9
Yes, multiple times. Will they now autostart, or I need to start them manually every time?
Dim
(Angelos)
December 6, 2018, 1:42pm
10
if you already restarted your OH2 service and they still come up as Resolved… this maybe worth posting an Issue on github (some dependency may be missing)
can you try to bundle:diag 230
(and 231) when you restart and they are stuck in resolved to see what Karaf has to say about them?
and maybe: bundle:requirements 230
(and 231)
1 Like
ncwekjn
(First Last)
December 6, 2018, 1:58pm
11
I’ve restarted OpenHAB and they’ve come online automatically:
openhab> bundle:list -s|grep -i JDBC
230 │ Active │ 80 │ 1.3.5.0 │ org.mariadb.jdbc
231 │ Active │ 80 │ 1.13.0.M6 │ org.openhab.persistence.jdbc
So they indeed needed a kick
Otherwise I see no issues:
openhab> bundle:diag 230
openhab> bundle:diag 231
openhab> bundle:requirements 230
org.mariadb.jdbc_1.3.5.0 [230] requires:
----------------------------------------
osgi.wiring.package; (osgi.wiring.package=javax.net) resolved by:
osgi.wiring.package; javax.net 0.0.0 from org.eclipse.osgi_3.12.100.v20180210-1608 [0]
osgi.wiring.package; (osgi.wiring.package=javax.net.ssl) resolved by:
osgi.wiring.package; javax.net.ssl 0.0.0 from org.eclipse.osgi_3.12.100.v20180210-1608 [0]
osgi.wiring.package; (osgi.wiring.package=javax.sql) resolved by:
osgi.wiring.package; javax.sql 0.0.0 from org.eclipse.osgi_3.12.100.v20180210-1608 [0]
osgi.wiring.package; (osgi.wiring.package=javax.transaction.xa) resolved by:
osgi.wiring.package; javax.transaction.xa 1.1.0 from org.apache.geronimo.specs.geronimo-jta_1.1_spec_1.1.1 [41]
openhab> bundle:requirements 231
org.openhab.persistence.jdbc_1.13.0.M6 [231] requires:
------------------------------------------------------
osgi.wiring.package; (osgi.wiring.package=org.apache.commons.collections.iterators) resolved by:
osgi.wiring.package; org.apache.commons.collections.iterators 3.2.1 from org.apache.commons.collections_3.2.1 [35]
osgi.wiring.package; (osgi.wiring.package=org.apache.commons.lang) resolved by:
osgi.wiring.package; org.apache.commons.lang 2.6.0 from org.apache.commons.lang_2.6.0 [38]
osgi.wiring.package; (osgi.wiring.package=org.joda.time) resolved by:
osgi.wiring.package; org.joda.time 0.0.0 from org.eclipse.smarthome.model.persistence_0.10.0.oh240M6 [132]
osgi.wiring.package; (osgi.wiring.package=org.joda.time.format) resolved by:
osgi.wiring.package; org.joda.time.format 0.0.0 from org.eclipse.smarthome.model.persistence_0.10.0.oh240M6 [132]
osgi.wiring.package; (osgi.wiring.package=org.mariadb.jdbc) resolved by:
osgi.wiring.package; org.mariadb.jdbc 0.0.0 from org.mariadb.jdbc_1.3.5.0 [230]
osgi.wiring.package; (osgi.wiring.package=org.openhab.core.autoupdate) resolved by:
osgi.wiring.package; org.openhab.core.autoupdate 0.0.0 from org.openhab.core.compat1x_2.4.0.M6 [223]
osgi.wiring.package; (osgi.wiring.package=org.openhab.core.binding) resolved by:
osgi.wiring.package; org.openhab.core.binding 0.0.0 from org.openhab.core.compat1x_2.4.0.M6 [223]
osgi.wiring.package; (osgi.wiring.package=org.openhab.core.items) resolved by:
osgi.wiring.package; org.openhab.core.items 0.0.0 from org.openhab.core.compat1x_2.4.0.M6 [223]
osgi.wiring.package; (osgi.wiring.package=org.openhab.core.library.items) resolved by:
osgi.wiring.package; org.openhab.core.library.items 0.0.0 from org.openhab.core.compat1x_2.4.0.M6 [223]
osgi.wiring.package; (osgi.wiring.package=org.openhab.core.library.types) resolved by:
osgi.wiring.package; org.openhab.core.library.types 0.0.0 from org.openhab.core.compat1x_2.4.0.M6 [223]
osgi.wiring.package; (osgi.wiring.package=org.openhab.core.persistence) resolved by:
osgi.wiring.package; org.openhab.core.persistence 0.0.0 from org.openhab.core.compat1x_2.4.0.M6 [223]
osgi.wiring.package; (osgi.wiring.package=org.openhab.core.types) resolved by:
osgi.wiring.package; org.openhab.core.types 0.0.0 from org.openhab.core.compat1x_2.4.0.M6 [223]
osgi.wiring.package; (osgi.wiring.package=org.openhab.io.net.http) resolved by:
osgi.wiring.package; org.openhab.io.net.http 0.0.0 from org.openhab.core.compat1x_2.4.0.M6 [223]
osgi.wiring.package; (osgi.wiring.package=org.openhab.model.item.binding) resolved by:
osgi.wiring.package; org.openhab.model.item.binding 0.0.0 from org.openhab.core.compat1x_2.4.0.M6 [223]
osgi.wiring.package; (osgi.wiring.package=org.osgi.framework) resolved by:
osgi.wiring.package; org.osgi.framework 1.8.0 from org.eclipse.osgi_3.12.100.v20180210-1608 [0]
osgi.wiring.package; (osgi.wiring.package=org.slf4j) resolved by:
osgi.wiring.package; org.slf4j 1.7.25 from org.ops4j.pax.logging.pax-logging-api_1.10.1 [6]
osgi.ee; (&(osgi.ee=JavaSE)(version=1.7)) resolved by:
osgi.ee; JavaSE [1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0] from org.eclipse.osgi_3.12.100.v20180210-1608 [0]
service; [org.osgi.service.log.LogService, org.knopflerfish.service.log.LogService, org.ops4j.pax.logging.PaxLoggingService, org.osgi.service.cm.ManagedService] provided by:
org.ops4j.pax.logging.pax-logging-log4j2_1.10.1 [7]
service; [org.openhab.core.items.ItemRegistry, org.openhab.ui.items.ItemUIRegistry] provided by:
org.openhab.core.compat1x_2.4.0.M6 [223]
I wonder why it didn’t work initially…
1 Like