Hey @Dibbler42 !
Just wanted to tune in and say that you are not alone. Mapdb seems to be broken. I just set up a brand new OH 3.0M1 installation (no imports, did everything manually) and my logs are littered with the deserialization errors you mentioned. The states of the items are not restored on startup as well.
My persistence file looked like this:
Strategies {
default = everyUpdate
}
Items {
* : strategy = everyUpdate, restoreOnStartup
}
Like you I got these in openhab.log:
2020-10-30 08:38:40.009 [WARN ] [ence.mapdb.internal.StateTypeAdapter] - Couldn't deserialize state 'org.openhab.core.library.types.OnOffType@@@OFF': org.openhab.core.library.types.OnOffType cannot be found by org.openhab.persistence.mapdb_3.0.0.M1
2020-10-30 08:38:40.014 [WARN ] [pdb.internal.MapDbPersistenceService] - Deserialized invalid item: [FAILED toString()]
2020-10-30 08:38:40.017 [WARN ] [ence.mapdb.internal.StateTypeAdapter] - Couldn't deserialize state 'org.openhab.core.library.types.StringType@@@HEAT': org.openhab.core.library.types.StringType cannot be found by org.openhab.persistence.mapdb_3.0.0.M1
2020-10-30 08:38:40.020 [WARN ] [pdb.internal.MapDbPersistenceService] - Deserialized invalid item: [FAILED toString()]
2020-10-30 08:38:40.028 [WARN ] [ence.mapdb.internal.StateTypeAdapter] - Couldn't deserialize state 'org.openhab.core.library.types.QuantityType@@@21 °C': org.openhab.core.library.types.QuantityType cannot be found by org.openhab.persistence.mapdb_3.0.0.M1
2020-10-30 08:38:40.029 [WARN ] [pdb.internal.MapDbPersistenceService] - Deserialized invalid item: [FAILED toString()]
2020-10-30 08:38:40.033 [WARN ] [ence.mapdb.internal.StateTypeAdapter] - Couldn't deserialize state 'org.openhab.core.library.types.OpenClosedType@@@CLOSED': org.openhab.core.library.types.OpenClosedType cannot be found by org.openhab.persistence.mapdb_3.0.0.M1
2020-10-30 08:38:40.036 [WARN ] [pdb.internal.MapDbPersistenceService] - Deserialized invalid item: [FAILED toString()]
2020-10-30 08:38:40.042 [WARN ] [ence.mapdb.internal.StateTypeAdapter] - Couldn't deserialize state 'org.openhab.core.library.types.OpenClosedType@@@CLOSED': org.openhab.core.library.types.OpenClosedType cannot be found by org.openhab.persistence.mapdb_3.0.0.M1
2020-10-30 08:38:40.045 [WARN ] [pdb.internal.MapDbPersistenceService] - Deserialized invalid item: [FAILED toString()]
etc. etc.
I also got tons of these NPEs on the console:
SLF4J: Failed toString() invocation on an object of type [org.openhab.persistence.mapdb.internal.MapDbItem]
Reported exception:
java.lang.NullPointerException
at org.openhab.persistence.mapdb.internal.MapDbItem.toString(MapDbItem.java:69)
at org.slf4j.helpers.MessageFormatter.safeObjectAppend(MessageFormatter.java:299)
at org.slf4j.helpers.MessageFormatter.deeplyAppendParameter(MessageFormatter.java:271)
at org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:233)
at org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:173)
at org.slf4j.helpers.MessageFormatter.format(MessageFormatter.java:124)
at org.ops4j.pax.logging.slf4j.Slf4jLogger.warn(Slf4jLogger.java:752)
I then set RRD4J as my default persistence in the UI and uninstalled mapdb. I then restarted openHAB and there were no more of these logs. The item states got restored.
I had one problem with a Number item, though. It had the value 4 and got restored as 4.0 (which caused a transformation .map lookup to fail immediately after the restart because there only was a mapping for 4 (not 4.0). This corrected itself, presumably because the rule got triggered that updates this. Never had this problem before and will monitor it.
2020-10-30 09:09:34.275 [WARN ] [rm.AbstractFileTransformationService] - Could not transform '4.0' with the file 'daylightLevel.map' : Target value not found in map for '4.0'
EDIT: openHAB 3.0M1 @ MacOS Catalina
Jens