activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Bertram <jbert...@redhat.com>
Subject Re: wildfly-10.1.0.Final integration for MQTT not working
Date Tue, 26 Sep 2017 16:53:43 GMT
I also just tested with the MQTTBox Chrome plugin and it worked fine as
well.


Justin

On Tue, Sep 26, 2017 at 11:28 AM, Justin Bertram <jbertram@redhat.com>
wrote:

> Here's my module.xml:
>
> <module xmlns="urn:jboss:module:1.5" name="org.apache.activemq.
> artemis.protocol.mqtt">
>     <resources>
>         <resource-root path="artemis-mqtt-protocol-1.5.5.jbossorg-007.jar"
> />
>     </resources>
>
>     <dependencies>
>         <module name="io.netty"/>
>         <!-- required to load ActiveMQ protocol SPI -->
>         <module name="org.apache.activemq.artemis"/>
>         <module name="org.jboss.logging"/>
>     </dependencies>
> </module>
>
> I added this to standalone-full.xml:
>
>     <profile>
>         ...
>         <subsystem xmlns="urn:jboss:domain:messaging-activemq:2.0">
>             ...
>                 <security enabled="false"/>
>                 ...
>                 <remote-acceptor name="mqtt-acceptor"
> socket-binding="mqtt">
>                  <param name="protocols" value="MQTT"/>
>                 </remote-acceptor>
>             ...
>         </subsystem>
>         ...
>     </profile>
>     ...
>     <socket-binding-group name="standard-sockets"
> default-interface="public" port-offset="${jboss.socket.
> binding.port-offset:0}">
>         ...
>         <socket-binding name="mqtt" port="1883"/>
>     </socket-binding-group>
>
>
> Justin
>
>
> On Tue, Sep 26, 2017 at 11:18 AM, Justin Bertram <jbertram@redhat.com>
> wrote:
>
>> FWIW I just integrated MQTT with Wildfly 11.0.0.CR1 and
>> ran org.apache.activemq.artemis.tests.integration.mqtt.
>> imported.MQTTTest#testSendAndReceiveMQTT against it and everything
>> worked.
>>
>>
>> Justin
>>
>> On Tue, Sep 26, 2017 at 10:55 AM, Justin Bertram <jbertram@redhat.com>
>> wrote:
>>
>>> The Artemis integration code for Wildfly is in the Wildfly project [1].
>>>
>>> The problem you hit in Wildfly 11.0.0.CR1 looks odd to me.  The
>>> class io.netty.handler.codec.mqtt.MqttEncoder from Netty 4.1.9.Final
>>> (which ships in Wildfly) does, in fact, contain the field "INSTANCE" so I'm
>>> not sure why you would be getting this exception unless there was something
>>> odd going on with the classloading or something.
>>>
>>> Also, the integration instructions in the WFLY-9372 JIRA say to copy
>>> netty-codec-mqtt-5.0.0.Alpha2.jar into the org.apache.activemq.artemis.protocol.mqtt
>>> module, but that shouldn't be necessary in Wildfly 11.0.0.CR1 as the
>>> io.netty module already contains those classes.  I also don't see why
>>> the org.apache.activemq.artemis.protocol.mqtt module would need
>>> dependencies on javax.jms.api, javax.api, or org.slf4j.
>>>
>>>
>>> Justin
>>>
>>> [1] https://github.com/wildfly/wildfly (see the "messaging-activemq"
>>> module)
>>>
>>> On Tue, Sep 26, 2017 at 10:17 AM, thoutekier <thomas.houtekier@barco.com
>>> > wrote:
>>>
>>>> * using artemis-1.1.0 standalone works out-of-the-box: it has by default
>>>> support for MQTT in the config, and it works if I connect using an
>>>> MQTT-client
>>>>
>>>> * using Wildfly-11.0.0.CR1:
>>>> 2017-09-26 17:12:25,837 WARNING [io.netty.channel.DefaultChann
>>>> elPipeline]
>>>> (Thread-2 (activemq-netty-threads)) An exceptionCaught() event was
>>>> fired,
>>>> and it reached at the tail of the pipeline. It usually means the last
>>>> handler in the pipeline did not handle the exception.:
>>>> io.netty.handler.codec.DecoderException: java.lang.NoSuchFieldError:
>>>> INSTANCE
>>>>         at
>>>> io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteT
>>>> oMessageDecoder.java:442)
>>>>         at
>>>> io.netty.handler.codec.ByteToMessageDecoder.channelRead(Byte
>>>> ToMessageDecoder.java:248)
>>>>         at
>>>> org.apache.activemq.artemis.core.protocol.ProtocolHandler$Pr
>>>> otocolDecoder.channelRead(ProtocolHandler.java:128)
>>>>         at
>>>> io.netty.channel.AbstractChannelHandlerContext.invokeChannel
>>>> Read(AbstractChannelHandlerContext.java:362)
>>>>         at
>>>> io.netty.channel.AbstractChannelHandlerContext.invokeChannel
>>>> Read(AbstractChannelHandlerContext.java:348)
>>>>         at
>>>> io.netty.channel.AbstractChannelHandlerContext.fireChannelRe
>>>> ad(AbstractChannelHandlerContext.java:340)
>>>>         at
>>>> io.netty.channel.DefaultChannelPipeline$HeadContext.channelR
>>>> ead(DefaultChannelPipeline.java:1334)
>>>>         at
>>>> io.netty.channel.AbstractChannelHandlerContext.invokeChannel
>>>> Read(AbstractChannelHandlerContext.java:362)
>>>>         at
>>>> io.netty.channel.AbstractChannelHandlerContext.invokeChannel
>>>> Read(AbstractChannelHandlerContext.java:348)
>>>>         at
>>>> io.netty.channel.DefaultChannelPipeline.fireChannelRead(Defa
>>>> ultChannelPipeline.java:926)
>>>>         at
>>>> io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.re
>>>> ad(AbstractNioByteChannel.java:134)
>>>>         at
>>>> io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEven
>>>> tLoop.java:624)
>>>>         at
>>>> io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimiz
>>>> ed(NioEventLoop.java:559)
>>>>         at
>>>> io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEve
>>>> ntLoop.java:476)
>>>>         at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
>>>>         at
>>>> io.netty.util.concurrent.SingleThreadEventExecutor$5.run(Sin
>>>> gleThreadEventExecutor.java:858)
>>>>         at java.lang.Thread.run(Thread.java:745)
>>>> Caused by: java.lang.NoSuchFieldError: INSTANCE
>>>>         at
>>>> org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolM
>>>> anager.addChannelHandlers(MQTTProtocolManager.java:113)
>>>>         at
>>>> org.apache.activemq.artemis.core.protocol.ProtocolHandler$Pr
>>>> otocolDecoder.decode(ProtocolHandler.java:181)
>>>>         at
>>>> io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteT
>>>> oMessageDecoder.java:411)
>>>>         ... 16 more
>>>>
>>>>
>>>> So it seems that it is in fact a problem in Wildfly.
>>>> Any idea where I could find the code for the artemis-integration in
>>>> wildly?
>>>> I don't find any branch/tag on
>>>> https://github.com/apache/activemq-artemis/tree/1.x/artemis-
>>>> protocols/artemis-mqtt-protocol
>>>> for "artemis-mqtt-protocol-1.1.0.wildfly-017"
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805
>>>> .html
>>>>
>>>
>>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message