Error processing protocol message: SUBSCRIBE

With the updated OH 2.5 stable I still have issues with the embedded MQTT broker. I have ESP devices which connects to the MQTT but some times when they reboot and connects back the log is flooded with this error:

2019-12-23 15:18:06.050 [ERROR] [.moquette.broker.NewNettyMQTTHandler] - Error processing protocol message: SUBSCRIBE
java.lang.NullPointerException: null
	at io.moquette.broker.PostOffice.subscribeClientToTopics(PostOffice.java:86) ~[bundleFile:?]
	at io.moquette.broker.MQTTConnection.processSubscribe(MQTTConnection.java:307) ~[bundleFile:?]
	at io.moquette.broker.MQTTConnection.handleMessage(MQTTConnection.java:71) ~[bundleFile:?]
	at io.moquette.broker.NewNettyMQTTHandler.channelRead(NewNettyMQTTHandler.java:58) [bundleFile:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]
	at io.moquette.broker.metrics.MQTTMessageLogger.channelRead(MQTTMessageLogger.java:46) [bundleFile:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]
	at io.moquette.broker.metrics.MessageMetricsHandler.channelRead(MessageMetricsHandler.java:50) [bundleFile:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328) [bundleFile:4.1.42.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:315) [bundleFile:4.1.42.Final]
	at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:349) [bundleFile:4.1.42.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:283) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]
	at io.moquette.broker.metrics.BytesMetricsHandler.channelRead(BytesMetricsHandler.java:51) [bundleFile:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:287) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1422) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:931) [bundleFile:4.1.42.Final]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [bundleFile:4.1.42.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700) [bundleFile:4.1.42.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635) [bundleFile:4.1.42.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552) [bundleFile:4.1.42.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) [bundleFile:4.1.42.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.42.Final]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

2019-12-23 15:18:06.090 [ERROR] [.moquette.broker.NewNettyMQTTHandler] - Unexpected exception while processing MQTT message. Closing Netty channel. CId=LivingRoom02
java.lang.NullPointerException: null
	at io.moquette.broker.MQTTConnection.handleConnectionLost(MQTTConnection.java:255) ~[?:?]
	at io.moquette.broker.NewNettyMQTTHandler.channelInactive(NewNettyMQTTHandler.java:82) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236) [bundleFile:4.1.42.Final]
	at io.moquette.broker.metrics.MQTTMessageLogger.channelInactive(MQTTMessageLogger.java:109) [bundleFile:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236) [bundleFile:4.1.42.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:393) [bundleFile:4.1.42.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:358) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236) [bundleFile:4.1.42.Final]
	at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:81) [bundleFile:4.1.42.Final]
	at io.moquette.broker.AutoFlushHandler.channelInactive(AutoFlushHandler.java:90) [bundleFile:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236) [bundleFile:4.1.42.Final]
	at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:81) [bundleFile:4.1.42.Final]
	at io.netty.handler.timeout.IdleStateHandler.channelInactive(IdleStateHandler.java:278) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236) [bundleFile:4.1.42.Final]
	at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:81) [bundleFile:4.1.42.Final]
	at io.moquette.broker.InflightResender.channelInactive(InflightResender.java:123) [bundleFile:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236) [bundleFile:4.1.42.Final]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1417) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243) [bundleFile:4.1.42.Final]
	at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:913) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:819) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510) [bundleFile:4.1.42.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) [bundleFile:4.1.42.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.42.Final]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

I found similar topic in the forum where the solution was to switch back to Mosquitto.
According to rlkoshak Moquette is abandoned by its developer. Is there any news regarding this?
Should I just totally forget the embedded broker and use Mosquitto instead or will this ever be stabilized?

Thanks a lot!

Yes, uninstall the embedded broker, stop OH, clean cache, and restart. Once back up and running, if using openhabian, go to openhabian-config tool and install the broker from there. You shouldn’t need to make changes to your things and item.

I have something similar going on. Lately it’s about once per day that the MQTT broker just quits and these logs (below) begin. What’s actually happening with the MQTT broker to cause this?

2019-12-25 18:39:34.374 [ERROR] [.moquette.broker.NewNettyMQTTHandler] - Error processing protocol message: SUBSCRIBE
java.lang.IllegalArgumentException: Could not deserialize [-84, -19, 0, 5, 115, 114, 0, 45, 105, 111, 46, 109, 111, 113, 117, 101, 116, 116, 101, 46, 98, 114, 111, 107, 101, 114, 46, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 46, 83, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, -47, 11, -117, 54, 80, -6, 26, -58, 2, 0, 3, 76, 0, 8, 99, 108, 105, 101, 110, 116, 73, 100, 116, 0, 18, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 76, 0, 12, 114, 101, 113, 117, 101, 115, 116, 101, 100, 81, 111, 115, 116, 0, 37, 76, 105, 111, 47, 110, 101, 116, 116, 121, 47, 104, 97, 110, 100, 108, 101, 114, 47, 99, 111, 100, 101, 99, 47, 109, 113, 116, 116, 47, 77, 113, 116, 116, 81, 111, 83, 59, 76, 0, 11, 116, 111, 112, 105, 99, 70, 105, 108, 116, 101, 114, 116, 0, 40, 76, 105, 111, 47, 109, 111, 113, 117, 101, 116, 116, 101, 47, 98, 114, 111, 107, 101, 114, 47, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 47, 84, 111, 112, 105, 99, 59, 120, 112, 116, 0, 7, 111, 112, 101, 110, 104,... [1.4.199/0]
	at org.h2.mvstore.DataUtils.newIllegalArgumentException(DataUtils.java:857) ~[bundleFile:1.4.199]
	at org.h2.mvstore.type.ObjectDataType.deserialize(ObjectDataType.java:376) ~[bundleFile:1.4.199]
	at org.h2.mvstore.type.ObjectDataType$SerializedObjectType.read(ObjectDataType.java:1547) ~[bundleFile:1.4.199]
	at org.h2.mvstore.type.ObjectDataType.read(ObjectDataType.java:231) ~[bundleFile:1.4.199]
	at org.h2.mvstore.type.ObjectDataType.read(ObjectDataType.java:114) ~[bundleFile:1.4.199]
	at org.h2.mvstore.Page$Leaf.readPayLoad(Page.java:1551) ~[bundleFile:1.4.199]
	at org.h2.mvstore.Page.read(Page.java:695) ~[bundleFile:1.4.199]
	at org.h2.mvstore.Page.read(Page.java:238) ~[bundleFile:1.4.199]
	at org.h2.mvstore.MVStore.readPage(MVStore.java:2187) ~[bundleFile:1.4.199]
	at org.h2.mvstore.MVMap.readPage(MVMap.java:554) ~[bundleFile:1.4.199]
	at org.h2.mvstore.Page$NonLeaf.getChildPage(Page.java:1086) ~[bundleFile:1.4.199]
	at org.h2.mvstore.MVMap.traverseDown(MVMap.java:1877) ~[bundleFile:1.4.199]
	at org.h2.mvstore.MVMap.operate(MVMap.java:1664) ~[bundleFile:1.4.199]
	at org.h2.mvstore.MVMap.put(MVMap.java:151) ~[bundleFile:1.4.199]
	at io.moquette.persistence.H2SubscriptionsRepository.addNewSubscription(H2SubscriptionsRepository.java:41) ~[bundleFile:?]
	at io.moquette.broker.subscriptions.CTrieSubscriptionDirectory.add(CTrieSubscriptionDirectory.java:88) ~[bundleFile:?]
	at io.moquette.broker.PostOffice.subscribeClientToTopics(PostOffice.java:81) ~[bundleFile:?]
	at io.moquette.broker.MQTTConnection.processSubscribe(MQTTConnection.java:307) ~[bundleFile:?]
	at io.moquette.broker.MQTTConnection.handleMessage(MQTTConnection.java:71) ~[bundleFile:?]
	at io.moquette.broker.NewNettyMQTTHandler.channelRead(NewNettyMQTTHandler.java:58) [bundleFile:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]
	at io.moquette.broker.metrics.MQTTMessageLogger.channelRead(MQTTMessageLogger.java:46) [bundleFile:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]
	at io.moquette.broker.metrics.MessageMetricsHandler.channelRead(MessageMetricsHandler.java:50) [bundleFile:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328) [bundleFile:4.1.42.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:302) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]
	at io.moquette.broker.metrics.BytesMetricsHandler.channelRead(BytesMetricsHandler.java:51) [bundleFile:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:287) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1422) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:931) [bundleFile:4.1.42.Final]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [bundleFile:4.1.42.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700) [bundleFile:4.1.42.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635) [bundleFile:4.1.42.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552) [bundleFile:4.1.42.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) [bundleFile:4.1.42.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.42.Final]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
Caused by: java.lang.ClassNotFoundException: io.moquette.broker.subscriptions.Subscription cannot be found by com.h2database.mvstore_1.4.199
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150) ~[org.eclipse.osgi-3.12.100.jar:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_232]
	at java.lang.Class.forName0(Native Method) ~[?:1.8.0_232]
	at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_232]
	at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:686) ~[?:1.8.0_232]
	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1868) ~[?:1.8.0_232]
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1751) ~[?:1.8.0_232]
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2042) ~[?:1.8.0_232]
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573) ~[?:1.8.0_232]
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:431) ~[?:1.8.0_232]
	at org.h2.mvstore.type.ObjectDataType.deserialize(ObjectDataType.java:374) ~[bundleFile:1.4.199]

Try changing over to mosquitto broker instead of the embedded one (moquette) or set the binding to DEBUG or TRACE and see if you get more info.

@H102 this always seems more simple that it becomes. I’ve struggled with mosquitto in the past and am again. I’ve uninstalled the Moquette broker and installed mosquitto, but I can’t connect to it. When started normally, the log file looks like this:

1577382089: mosquitto version 1.6.8 starting
1577382089: Config loaded from /etc/mosquitto/mosquitto.conf.
1577382089: Opening ipv6 listen socket on port 1883.
1577382089: Opening ipv4 listen socket on port 1883.
1577382118: New connection from 127.0.0.1 on port 1883.

However there’s no communication, and I can’t connect to it using MQTT.fx. I’ve defined the broker as:

Bridge mqtt:broker:mosquitto  "Mosquitto" [ host="127.0.0.1", secure=false, clientID="openHAB2" ] 

and have no user or password set up in mosquitto. If I start the mosquitto console on my server, everything connects properly with the additional log entry:

1577382118: New client connected from 127.0.0.1 as fcbabf5c-d3a0-4906-8eb1-378c3ca9dee7 (p2, c1, k60).

Now you need to create a “generic mqtt thing” for each of your Things. BTW I see your configuration for the bridge but no Things/channels.?

Sorry, I didn’t include them for brevity. Here’s the full things file (which is working just fine when I have mosquitto launched under the console):

Bridge mqtt:broker:mosquitto  "Mosquitto" [ host="127.0.0.1", secure=false, clientID="openHAB2" ] 
{
    Thing topic Sonoff_Coop_Thing "Sonoff Coop" @ "Chicken Coop" {
    Channels: 
        Type switch : power "Power"             [ stateTopic="stat/Sonoff_Coop/POWER", commandTopic="cmnd/Sonoff_Coop/POWER" ]
        Type number : temperature "Temperature" [ stateTopic="tele/Sonoff_Coop/SENSOR", transformationPattern="JSONPATH:$.SI7021.Temperature", pollingPeriod=3000]
        Type number : humidity "Humidity"       [ stateTopic="tele/Sonoff_Coop/SENSOR", transformationPattern="JSONPATH:$.SI7021.Humidity"]
    }
    Thing topic Sonoff_Garage_Thing "Sonoff Garage" @ "Garage" {
        Type switch : power "On Signal"         [ stateTopic="stat/Sonoff_Garage/POWER", commandTopic="cmnd/Sonoff_Garage/POWER"]
        Type number : temperature "Temperature" [ stateTopic="tele/Sonoff_Garage/SENSOR", transformationPattern="JSONPATH:$.SI7021.Temperature", pollingPeriod=3000]
        Type number : humidity "Humidity"       [ stateTopic="tele/Sonoff_Garage/SENSOR", transformationPattern="JSONPATH:$.SI7021.Humidity"]
    }
    Thing topic Sonoff_Freezer1_Thing "Sonoff Freezer-1" @ "Garage" {
        Type switch : power "On Signal"         [ stateTopic="stat/Sonoff_Freezer1/POWER", commandTopic="cmnd/Sonoff_Freezer1/POWER"]
        Type number : temperature "Temperature" [ stateTopic="tele/Sonoff_Freezer1/SENSOR", transformationPattern="JSONPATH:$.SI7021.Temperature"]
        Type number : humidity "Humidity"       [ stateTopic="tele/Sonoff_Freezer1/SENSOR", transformationPattern="JSONPATH:$.SI7021.Humidity"]
    }
    Thing topic Sonoff_Livingroom_Fireplace_Thing "Sonoff Livingroom Fireplace" @ "Main Floor" {
        Type switch : power "On Signal"         [ stateTopic="stat/Sonoff_Livingroom_Fireplace", commandTopic="cmnd/Sonoff_Livingroom_Fireplace/POWER"]
    } 
    Thing topic Sonoff_Basement_Fireplace_Thing "Sonoff Basement Fireplace" @ "Basement" {
        Type switch : power "On Signal"         [ stateTopic="stat/Sonoff_Basement_Fireplace", commandTopic="cmnd/Sonoff_Basement_Fireplace/POWER"]
    } 
    Thing topic Sonoff_Shop_Thing "Sonoff Shop" @ "Shop" {
        Type switch : power "On Signal"         [ stateTopic="stat/Sonoff_Shop/POWER", commandTopic="cmnd/Sonoff_Shop/POWER"]
        Type number : temperature "Temperature" [ stateTopic="tele/Sonoff_Shop/SENSOR", transformationPattern="JSONPATH:$.SI7021.Temperature", pollingPeriod=3000]
        Type number : humidity "Humidity"       [ stateTopic="tele/Sonoff_Shop/SENSOR", transformationPattern="JSONPATH:$.SI7021.Humidity"]
    }

}

Well, I have to modify my last statement. All of my devices are connected to the broker (or at least their logs state they are) but there aren’t commands or data being passed.

So it works and you can control all devices?

It would seem at this point that mosquitto is connecting to my devices, but OpenHAB is not communicating with mosquitto. Again when running in console I can now connect using MQTT.fx but I’m not seeing any device updates in OpenHAB

What version of OH are you running?

Where are the Items from items file?

Where are you looking for device updates, in logs, PaperUI, BacisUI, etc…?

Have you uninstalled the other broker, stopped OH, cleaned the cache and restarted.?

version 2.5.0
I had done everything, except to clear the cache, which is now done as well.
I’m logging into my device logs (I have mostly reflashed Sonoff devices) and am looking at their status directly.
The problem doesn’t seem to be with OH, rather something with mosquitto or the port, but the mosquitto logs are not mentioning a port conflict. Again I can’t connect to mosquitto using MQTT.fx

In paperUI check the mqtt thing (the broker) by clicking on the pencil icon. Click on show more in bottom left and make sure all info is correct such as IP, port, etc…

Try publishing/subscribing to a topic from the command line of OH.

Example for a light ON/OFF:
mosquitto_pub -h 10.0.1.19 -p 1883 -t zigbee/light/set -m Off

Just replace with your IP, port, and topic.

Also, you may want to consider installing frontail log from openhabain tool to watch logs from a web browser…can make troubleshooting easier.:wink:
@DaveL Change your IP address from loopback (127.0.0.1) to the actual IP that OH is using.

@H102 change the IP address where?

In the things file and it should show the same in PaperUI. If not then restart OH and recheck.

I’m somewhat convinced I have a configuration error somewhere, as mosquitto seems to be working but nothing connects, and I can’t communicate in any medium. @H102, what settings do you have in your mosquitto.conf, default.conf and mqtt.cfg files? And how did you define your bridge in your things file? Thanks again!

For mqtt 2.x this is handled in PaperUI and mqtt 1.x uses the mqtt.cfg file. Either way the info needed is IP address, port, user name, and password.

FYI: My Things and items are in seperate files…I copied this from another post.

Thing:

Bridge mqtt:broker:pibroker "pibroker" [ host="10.0.1.19", port=1883, secure=false, username="xxxxxxxx", password="xxxxxxxx" ]
{
    // Sonoffs
    Thing topic sonoff11 "Living Room Light" @ "Living Room" {
    Channels:
        Type switch : power       "Power"         [ stateTopic="stat/sonoff11/POWER", commandTopic="cmnd/sonoff11/POWER" ]
        Type number : temperature "Temperature"   [ stateTopic="tele/sonoff11/SENSOR", transformationPattern="JSONPATH:$.SI7021.Temperature" ]
        Type number : humidity    "Humidity"      [ stateTopic="tele/sonoff11/SENSOR", transformationPattern="JSONPATH:$.SI7021.Humidity" ]
    }

    Thing topic sonoff2 "Couch Light" @ "Couch Light" {
    Channels:
        Type switch : power        "Power"         [ stateTopic="stat/sonoff2/POWER", commandTopic="cmnd/sonoff2/POWER" ]
    }

    Thing topic sonoff55 "Office Light" @ "Office" {
    Channels:
        Type switch : power        "Power"         [ stateTopic="stat/sonoff55/POWER", commandTopic="cmnd/sonoff55/POWER" ]
    }
}

Item:

Switch LivingRoom_Light "Living Room Light" <light>  ["Lighting"] { channel="mqtt:topic:pibroker:sonoff11:power" }
Number LivingRoom_Light_Temp "Temperature [%.1f °F]"      <temp>             { channel="mqtt:topic:pibroker:sonoff11:temperature" }
Number LivingRoom_Light_Humidity    "Humidity [%.1f %%]"    <humidity>       { channel="mqtt:topic:pibroker:sonoff11:humidity" }

Switch CouchLight "Couch Light" <light>  ["Lighting"]  { channel="mqtt:topic:pibroker:sonoff2:power" }

Switch OfficeLight "Office Light" <light>  ["Lighting"]  { channel="mqtt:top

So I should make no changes in any of those files and leave them to default settings?
And just to clarify, in OH I would ONLY install the MQTT binding?

Yes the binding in PaperUI > addons > bindings. Nothing mqtt related from the MISC addons section.

Ok, I’m getting close. Mosquitto is now functioning and my devices are now connecting to it (as seen on their individual consoles). OH is communicating with it, I have entries in my log files when I manipulate a switch locally. But my OH consoles are not reflecting their correct states and I cannot control them from OH.
I’ve effectively copied your thing broker configuration and left the rest of the file as-is (as the devices were working:

Bridge mqtt:broker:mosquitto  "Mosquitto Broker" [ host="10.1.10.50", port=1883, secure=false, username="xxxxxxxx", password="xxxxxxxx"  ] 
{
    Thing topic Sonoff_Coop_Thing "Sonoff Coop" @ "Chicken Coop" {
    Channels: 
        Type switch : power "Power"             [ stateTopic="stat/Sonoff_Coop/POWER", commandTopic="cmnd/Sonoff_Coop/POWER" ]
        Type number : temperature "Temperature" [ stateTopic="tele/Sonoff_Coop/SENSOR", transformationPattern="JSONPATH:$.SI7021.Temperature", pollingPeriod=3000]
        Type number : humidity "Humidity"       [ stateTopic="tele/Sonoff_Coop/SENSOR", transformationPattern="JSONPATH:$.SI7021.Humidity"]
    }
    Thing topic Sonoff_Garage_Thing "Sonoff Garage" @ "Garage" {
        Type switch : power "On Signal"         [ stateTopic="stat/Sonoff_Garage/POWER", commandTopic="cmnd/Sonoff_Garage/POWER"]
        Type number : temperature "Temperature" [ stateTopic="tele/Sonoff_Garage/SENSOR", transformationPattern="JSONPATH:$.SI7021.Temperature", pollingPeriod=3000]
        Type number : humidity "Humidity"       [ stateTopic="tele/Sonoff_Garage/SENSOR", transformationPattern="JSONPATH:$.SI7021.Humidity"]
    }
    Thing topic Sonoff_Freezer1_Thing "Sonoff Freezer-1" @ "Garage" {
        Type switch : power "On Signal"         [ stateTopic="stat/Sonoff_Freezer1/POWER", commandTopic="cmnd/Sonoff_Freezer1/POWER"]
        Type number : temperature "Temperature" [ stateTopic="tele/Sonoff_Freezer1/SENSOR", transformationPattern="JSONPATH:$.SI7021.Temperature"]
        Type number : humidity "Humidity"       [ stateTopic="tele/Sonoff_Freezer1/SENSOR", transformationPattern="JSONPATH:$.SI7021.Humidity"]
    }
    Thing topic Sonoff_Livingroom_Fireplace_Thing "Sonoff Livingroom Fireplace" @ "Main Floor" {
        Type switch : power "On Signal"         [ stateTopic="stat/Sonoff_Livingroom_Fireplace", commandTopic="cmnd/Sonoff_Livingroom_Fireplace/POWER"]
    } 
    Thing topic Sonoff_Basement_Fireplace_Thing "Sonoff Basement Fireplace" @ "Basement" {
        Type switch : power "On Signal"         [ stateTopic="stat/Sonoff_Basement_Fireplace", commandTopic="cmnd/Sonoff_Basement_Fireplace/POWER"]
    } 
    Thing topic Sonoff_Shop_Thing "Sonoff Shop" @ "Shop" {
        Type switch : power "On Signal"         [ stateTopic="stat/Sonoff_Shop/POWER", commandTopic="cmnd/Sonoff_Shop/POWER"]
        Type number : temperature "Temperature" [ stateTopic="tele/Sonoff_Shop/SENSOR", transformationPattern="JSONPATH:$.SI7021.Temperature", pollingPeriod=3000]
        Type number : humidity "Humidity"       [ stateTopic="tele/Sonoff_Shop/SENSOR", transformationPattern="JSONPATH:$.SI7021.Humidity"]
    }

}

Thanks again for your help (and patience…)