org.openhab.core.library.types.QuantityType not Serializable because of member variable 'logger'

The Class QuantityType is obviously supposed to be Serializable, because it contains a SerialVersionUID. Since it extends Number, it implicitly inherits Serializable interface from this class.
BUT: it cannot be serialized because it may contain a member-reference to non-serializable org.ops4j.pax.logging.slf4j.Slf4jLogger at runtime.

public class QuantityType<T extends Quantity<T>> extends Number
    implements PrimitiveType, State, Command, Comparable<QuantityType<T>> {
private final Logger logger = LoggerFactory.getLogger(QuantityType.class);

private static final long serialVersionUID = 8828949721938234629L;

Please make the variable ‘logger’ static

I am using stable Version 2.5.8-1

I think this would better be opened as an issue in GitHub at openhab-core

I don’t think I can do this since I am not an openhab developer and do probably not have access to GitHub at openhab-core

You just have to create an account on Github, the openhab-core repo is freely accessible.

Okay, opened issue #1651 in openhab-core

1 Like

Thanks for reporting. A fix has been implemented. Be aware that it will be not available in OH2.5.x anymore. You have to wait for OH3 release or use current snapshot builds.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.