MySQL persistence broken after upgrade to latest OH2.2.0 snapshot

Tags: #<Tag:0x00007f616d6d6e80> #<Tag:0x00007f616d6d6c28> #<Tag:0x00007f616d6d6a20>

Hi!

I upgraded my Raspberry PI today to latest snapshot openHAB 2.2.0 Build #1066 via apt-get. My MySQL-persistence then stopped working, the openhab.log throws:

2017-10-21 23:15:53.488 [ERROR] [org.openhab.persistence.mysql       ] - [org.openhab.persistence.mysql(194)] The activate method has thrown an exception
java.lang.IllegalAccessError: tried to access method com.mysql.jdbc.ConnectionImpl.getInstance(Ljava/lang/String;ILjava/util/Properties;Ljava/lang/String;Ljava/lang/String;)Lcom/mysql/jdbc/Connection; fro
m class com.mysql.jdbc.NonRegisteringDriver
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346) ~[?:?]
        at java.sql.DriverManager.getConnection(DriverManager.java:664) ~[?:?]
        at java.sql.DriverManager.getConnection(DriverManager.java:247) ~[?:?]
        at org.openhab.persistence.mysql.internal.MysqlPersistenceService.connectToDatabase(MysqlPersistenceService.java:521) ~[?:?]
        at org.openhab.persistence.mysql.internal.MysqlPersistenceService.activate(MysqlPersistenceService.java:191) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
....
....
2017-10-21 23:15:53.806 [WARN ] [org.openhab.persistence.mysql       ] - FrameworkEvent WARNING - org.openhab.persistence.mysql
org.osgi.framework.ServiceException: org.apache.felix.scr.impl.manager.SingleComponentManager.getService() returned a null service object
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:232) ~[?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111) ~[?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45) ~[?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496) ~[?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461) ~[?:?]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619) ~[?:?]
....
....
2017-10-21 23:15:53.816 [ERROR] [org.openhab.persistence.mysql       ] - [org.openhab.persistence.mysql(194)] The activate method has thrown an exception
java.lang.IllegalAccessError: tried to access method com.mysql.jdbc.ConnectionImpl.getInstance(Ljava/lang/String;ILjava/util/Properties;Ljava/lang/String;Ljava/lang/String;)Lcom/mysql/jdbc/Connection; from class com.mysql.jdbc.NonRegisteringDriver
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346) ~[?:?]
        at java.sql.DriverManager.getConnection(DriverManager.java:664) ~[?:?]
        at java.sql.DriverManager.getConnection(DriverManager.java:247) ~[?:?]
        at org.openhab.persistence.mysql.internal.MysqlPersistenceService.connectToDatabase(MysqlPersistenceService.java:521) ~[?:?]
        at org.openhab.persistence.mysql.internal.MysqlPersistenceService.activate(MysqlPersistenceService.java:191) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

I’m running MySQL on the same RPI using the following mysql.cfg:

# the database url like 'jdbc:mysql://<host>:<port>/<database>' (without quotes)
url=jdbc:mysql://localhost:3306/OpenHAB

# the database user
user=openhab

# the database password
password=****

# the reconnection counter
#reconnectCnt=

# the connection timeout (in seconds)
#waitTimeout=

# Use MySQL Server time to store item values (=false) or use openHAB Server time (=true).
# For new installations, its recommend to set "localtime=true".
# (optional, defaults to false)
localtime=true

My mysql.persist:

// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
        // if no strategy is specified for an item entry below, the default list will be used
        everyMinute     : "0 * * * * ?"
        every5Minutes : "0 */5 * * * ?"
        everyHour   : "0 0 * * * ?"
        everyDay    : "0 0 0 * * ?"
        default = everyChange
}

Items {
    // persist all items once a day and on every change and restore them from the db at startup
    * : strategy = everyChange, everyDay, restoreOnStartup

    // additionally, persist all temperature and weather values every five minutes
    gTemp*, gHumid*, gRain*, gWind* : strategy = every5Minutes, restoreOnStartup
}

I’ve not installed the JDBC persistence, but it worked before today’s upgrade.

Any clues on what might be wrong?

BR,

/Janne