Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-9372

NullpointerException in artemis-server-1.1.0.wildfly-017 (and artemis-server-1.5.5.jbossorg-007.jar) when using MQTT

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 14.0.0.Final
    • 10.1.0.Final, 11.0.0.CR1
    • JMS
    • None
    • Hide
      • update wildfly-10.1.0.Final\modules\system\layers\base\org\apache\activemq\artemis\main\module.xml
        <!-- supported protocols (in addition to the CORE protocol) -->
                <module name="org.apache.activemq.artemis.protocol.amqp" services="import" optional="true"/>
                <module name="org.apache.activemq.artemis.protocol.hornetq" services="import" optional="true"/>
                <module name="org.apache.activemq.artemis.protocol.stomp" services="import" optional="true"/>
        		<module name="org.apache.activemq.artemis.protocol.mqtt" services="import" optional="true"/>
        
      • configure wildfly-10.1.0.Final\standalone\configuration\standalone-full-ha.xml : add acceptor for mqtt in messaging-activemq-subsystem (full config file in attachement)
         <acceptor name="mqtt-acceptor" factory-class="org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory">  
        	<param name="protocols" value="MQTT"/>  
        	<param name="port" value="1883"/>  
        	<param name="host" value="${jboss.bind.address:127.0.0.1}"/>
        </acceptor>  
        
      • start server with
        wildfly-10.1.0.Final\bin\standalone.bat --server-config=standalone-full-ha.xml -Djboss.bind.address=127.0.0.1
        
      • server.log: (complete log in attachement)
        2017-09-21 15:58:22,761 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 70) AMQ221043: Protocol module found: [artemis-mqtt-protocol]. Adding protocol support for: MQTT
        (...)
        2017-09-21 15:58:23,338 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 70) AMQ221020: Started Acceptor at 127.0.0.1:1883 for protocols [MQTT]
        2017-09-21 15:58:23,340 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 70) AMQ221007: Server is now live
        2017-09-21 15:58:23,343 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 70) AMQ221001: Apache ActiveMQ Artemis Message Broker version 1.1.0.wildfly-017 [nodeID=f4db9ab2-9ed3-11e7-9d9f-0593764809f6] 
        
      • connect mqtt-client (see screenshot in attachement). I used the MQTTBox chrome extention
      Show
      download Wildfly-10.1.0.Final from http://download.jboss.org/wildfly/10.1.0.Final/wildfly-10.1.0.Final.zip update artemis-module for mqtt-support: wildfly-10.1.0.Final\modules\system\layers\base\org\apache\activemq\artemis\protocol\mqtt\main\module.xml: <module xmlns= "urn:jboss:module:1.3" name= "org.apache.activemq.artemis.protocol.mqtt" > <resources> <resource-root path= "artemis-mqtt-protocol-1.1.0.wildfly-017.jar" /> <resource-root path= "netty-codec-mqtt-5.0.0.Alpha2.jar" /> </resources> <dependencies> <module name= "javax.jms.api" /> <module name= "javax.api" /> <module name= "io.netty" /> <module name= "org.slf4j" /> <module name= "org.apache.activemq.artemis" /> <module name= "org.jboss.logging" /> </dependencies> </module> (jars can be downloaded from https://mvnrepository.com/artifact/org.apache.activemq/artemis-mqtt-protocol/1.1.0.wildfly-017 and https://mvnrepository.com/artifact/io.netty/netty-codec-mqtt/5.0.0.Alpha2 update wildfly-10.1.0.Final\modules\system\layers\base\org\apache\activemq\artemis\main\module.xml <!-- supported protocols (in addition to the CORE protocol) --> <module name= "org.apache.activemq.artemis.protocol.amqp" services= " import " optional= " true " /> <module name= "org.apache.activemq.artemis.protocol.hornetq" services= " import " optional= " true " /> <module name= "org.apache.activemq.artemis.protocol.stomp" services= " import " optional= " true " /> <module name= "org.apache.activemq.artemis.protocol.mqtt" services= " import " optional= " true " /> configure wildfly-10.1.0.Final\standalone\configuration\standalone-full-ha.xml : add acceptor for mqtt in messaging-activemq-subsystem (full config file in attachement) <acceptor name= "mqtt-acceptor" factory-class= "org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory" > <param name= "protocols" value= "MQTT" /> <param name= "port" value= "1883" /> <param name= "host" value= "${jboss.bind.address:127.0.0.1}" /> </acceptor> start server with wildfly-10.1.0.Final\bin\standalone.bat --server-config=standalone-full-ha.xml -Djboss.bind.address=127.0.0.1 server.log: (complete log in attachement) 2017-09-21 15:58:22,761 INFO [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 70) AMQ221043: Protocol module found: [artemis-mqtt-protocol]. Adding protocol support for : MQTT (...) 2017-09-21 15:58:23,338 INFO [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 70) AMQ221020: Started Acceptor at 127.0.0.1:1883 for protocols [MQTT] 2017-09-21 15:58:23,340 INFO [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 70) AMQ221007: Server is now live 2017-09-21 15:58:23,343 INFO [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 70) AMQ221001: Apache ActiveMQ Artemis Message Broker version 1.1.0.wildfly-017 [nodeID=f4db9ab2-9ed3-11e7-9d9f-0593764809f6] connect mqtt-client (see screenshot in attachement). I used the MQTTBox chrome extention
    • User Experience

    Description

      When connecting a MQTT-client to a wildfly-10.1.0.Final (with embedded artemis 1.1.0), the following NPE is thrown.

      Sep:12,15:57:48,464 WARNING (:Thread-2 (activemq-netty-threads-345981593):) [io.netty.channel.DefaultChannelPipeline] 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.NullPointerException  
      at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:391) [netty-all-4.0.33.Final.jar:4.0.33.Final]  
      at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:311) [netty-all-4.0.33.Final.jar:4.0.33.Final]  
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:218) [netty-all-4.0.33.Final.jar:4.0.33.Final]  
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:204) [netty-all-4.0.33.Final.jar:4.0.33.Final]  
      at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:828) [netty-all-4.0.33.Final.jar:4.0.33.Final]  
      at io.netty.channel.AbstractChannel$AbstractUnsafe$7.run(AbstractChannel.java:625) [netty-all-4.0.33.Final.jar:4.0.33.Final]  
      at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358) [netty-all-4.0.33.Final.jar:4.0.33.Final]  
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357) [netty-all-4.0.33.Final.jar:4.0.33.Final]  
      at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112) [netty-all-4.0.33.Final.jar:4.0.33.Final]  
      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_112]  
      Caused by: java.lang.NullPointerException  
      at org.apache.activemq.artemis.core.protocol.ProtocolHandler$ProtocolDecoder.decode(ProtocolHandler.java:171) [artemis-server-1.1.0.wildfly-017.jar:]  
      at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:360) [netty-all-4.0.33.Final.jar:4.0.33.Final]  
      ... 9 more  
      

      for more info, see https://developer.jboss.org/message/976007

      Reproducing in straightforward, see 'steps to reproduce'.
      I'm not sure if this is related to the integration of artemis into wildfly, or to the artemis server itself.

      Attachments

        1. server.log
          36 kB
        2. screenshot.png
          screenshot.png
          40 kB
        3. standalone-full-ha.xml
          28 kB

        Issue Links

          Activity

            People

              jmesnil1@redhat.com Jeff Mesnil
              thomash_jira Thomas Houtekier (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: