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;
...
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.