Problem with MariaDB asi persistence server by JDBC

Tags: #<Tag:0x00007f617eb89b60> #<Tag:0x00007f617eb89980> #<Tag:0x00007f617eb89818>

Hi,
I had many months persistence service by “MySQL Persistence”. Few days ago I found that the persistence service does not worked whole time.
I changed persistence to JDBC MariaDb (I have MariadDB) but it does not work still.

I have OpenHab 2.5.2 with MariaDB on Rpi4.
I have already cleared database but without succes. Items does not created.
I tried cleaned cache. No success.

Can anybody help me pls?

I am getting there errors:

[ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'QueryablePersistenceService.query()' on 'org.openhab.core.persistence.internal.QueryablePersistenceServiceDelegate@1813401': java.lang.Integer cannot be cast to java.lang.Long
[ERROR] [ence.internal.PersistenceManagerImpl] - Exception occurred while querying persistence service 'jdbc': java.lang.Integer cannot be cast to java.lang.Long
[ERROR] [ence.internal.PersistenceManagerImpl] - Exception occurred while querying persistence service 'jdbc': java.lang.Integer cannot be cast to java.lang.Long
[WARN ] [pse.smarthome.core.items.GenericItem] - failed notifying listener 'org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl@e1654d' about state update of item Toilet_Temperature: java.lang.Integer cannot be cast to java.lang.Long

services/jdbc.cfg

url=jdbc:mariadb://127.0.0.1:3306/smarthome
user=username
password=dsf7686cvx
tableUseRealItemNames=true
numberDecimalcount=4

persistence/jdbc.persist

Strategies {
        everyMinute     : "0 * * * * ?"
        every5Minutes : "0 */5 * * * ?"
        everyHour   : "0 0 * * * ?"
        everyDay    : "0 0 0 * * ?"
        default = everyChange
}
Items {
* : strategy = everyChange, everyDay, restoreOnStartup
 gTemperatur* : strategy = every5Minutes, restoreOnStartup
}

Did you ever solve this? I have the same error.

I cannot say why this is not working, I just want to maybe give you a pointer, because I recently upgraded my working installation of 2.5.2 to 2.5.3, and my mysql persistence completely broke. No updates at all, and no errors in the log.

Solution for me was to download and (re)install the latest Connector/J from the MySQL web page. For mariadb the appropriate connector can be found here:


Perhaps you need to install this. It supposedly works for mysql too.

1 Like

I will check, thanks.

@panachoi Where did you put the jar? In /usr/share/openhab2/addons/?