Uploaded image for project: 'AMQ Broker'
  1. AMQ Broker
  2. ENTMQBR-104

NullPointerException when trying a null connection rempote properties are passed by client

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • A-MQ 7.0.0.GA
    • None
    • None
    • None

      When using AMQP clients (SASL mechanism ANONYMOUS is used) and broker with JAAS authentication configured with help of artemis create (script) and Apache Artemis documentation, Broker reports NullPointerException and client is stuck in making connection, because broker does not close the connection.

      in this case python AMQP reactive client was used.

      java.lang.NullPointerException
              at org.apache.activemq.artemis.core.protocol.proton.plug.ProtonSessionIntegrationCallback.rollbackCurrentTX(ProtonSessionIntegrationCallback.java:207)
              at org.proton.plug.context.AbstractProtonSessionContext.close(AbstractProtonSessionContext.java:142)
              at org.proton.plug.context.AbstractConnectionContext$LocalListener.onRemoteClose(AbstractConnectionContext.java:177)
              at org.proton.plug.handler.Events.dispatch(Events.java:46)
              at org.proton.plug.handler.impl.ProtonHandlerImpl.dispatch(ProtonHandlerImpl.java:337)
              at org.proton.plug.handler.impl.ProtonHandlerImpl.flush(ProtonHandlerImpl.java:257)
              at org.proton.plug.handler.impl.ProtonHandlerImpl.inputBuffer(ProtonHandlerImpl.java:158)
              at org.proton.plug.context.AbstractConnectionContext.inputBuffer(AbstractConnectionContext.java:81)
              at org.apache.activemq.artemis.core.protocol.proton.ActiveMQProtonRemotingConnection.bufferReceived(ActiveMQProtonRemotingConnection.java:127)
              at org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:605)
              at org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:68)
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
              at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
              at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
              at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
              at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
              at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
              at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
              at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
              at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
              at java.lang.Thread.run(Thread.java:745)
      org.proton.plug.exceptions.ActiveMQAMQPInternalErrorException: AMQ119031: Unable to validate user
              at org.proton.plug.context.AbstractProtonSessionContext.initialise(AbstractProtonSessionContext.java:71)
              at org.proton.plug.context.AbstractConnectionContext$LocalListener.onRemoteOpen(AbstractConnectionContext.java:193)
              at org.proton.plug.handler.Events.dispatch(Events.java:58)
              at org.proton.plug.handler.impl.ProtonHandlerImpl.dispatch(ProtonHandlerImpl.java:337)
              at org.proton.plug.handler.impl.ProtonHandlerImpl.flush(ProtonHandlerImpl.java:257)
              at org.proton.plug.handler.impl.ProtonHandlerImpl.inputBuffer(ProtonHandlerImpl.java:158)
              at org.proton.plug.context.AbstractConnectionContext.inputBuffer(AbstractConnectionContext.java:81)
              at org.apache.activemq.artemis.core.protocol.proton.ActiveMQProtonRemotingConnection.bufferReceived(ActiveMQProtonRemotingConnection.java:127)
              at org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:605)
              at org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:68)
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
              at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
              at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
              at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
              at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
              at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
              at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
              at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
              at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ119031: Unable to validate user]
              at org.apache.activemq.artemis.core.security.impl.SecurityStoreImpl.authenticate(SecurityStoreImpl.java:143)
              at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.createSession(ActiveMQServerImpl.java:992)
              at org.apache.activemq.artemis.core.protocol.proton.plug.ProtonSessionIntegrationCallback.init(ProtonSessionIntegrationCallback.java:95)
              at org.proton.plug.context.AbstractProtonSessionContext.initialise(AbstractProtonSessionContext.java:68)
              ... 19 more
      

      bootstrap.xml

      <broker xmlns="http://activemq.org/schema">
      
         <jaas-security domain="activemq"/>
      
         <server configuration="file:/opt/jboss-amq-1-i1/etc/broker.xml"/>
      
         <!-- The web server is only bound to loalhost by default -->
         <web bind="http://localhost:8161" path="web">
             <app url="jolokia" war="jolokia-war-1.3.1.war"/>
             <app url="hawtio" war="hawtio-web.war"/>
             <app url="artemis-plugin" war="artemis-plugin.war"/>
         </web>
      
      </broker>
      
      

      login.config

      activemq {
         org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule required
             debug=false
             org.apache.activemq.jaas.properties.user="artemis-users.properties"
             org.apache.activemq.jaas.properties.role="artemis-roles.properties";
      };
      

      broker.xml

      <?xml version='1.0'?>
      <!--
      Licensed to the Apache Software Foundation (ASF) under one
      or more contributor license agreements.  See the NOTICE file
      distributed with this work for additional information
      regarding copyright ownership.  The ASF licenses this file
      to you under the Apache License, Version 2.0 (the
      "License"); you may not use this file except in compliance
      with the License.  You may obtain a copy of the License at
      
        http://www.apache.org/licenses/LICENSE-2.0
      
      Unless required by applicable law or agreed to in writing,
      software distributed under the License is distributed on an
      "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
      KIND, either express or implied.  See the License for the
      specific language governing permissions and limitations
      under the License.
      -->
      
      <configuration xmlns="urn:activemq"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">
      
         <jms xmlns="urn:activemq:jms">
            <queue name="DLQ"/>
            <queue name="ExpiryQueue"/>
      
         </jms>
      
         <core xmlns="urn:activemq:core">
      
            <!-- this could be ASYNCIO or NIO
             -->
            <journal-type>NIO</journal-type>
      
            <paging-directory>./data/paging</paging-directory>
      
            <bindings-directory>./data/bindings</bindings-directory>
      
            <journal-directory>./data/journal</journal-directory>
      
            <large-messages-directory>./data/large-messages</large-messages-directory>
      
            <journal-min-files>10</journal-min-files>
      
            <!--
             This value was determined through a calculation.
             Your system could perform 0.12 writes per millisecond
             on the current journal configuration.
             That translates as a sync write every 8384000 nanoseconds
            -->
            <journal-buffer-timeout>8384000</journal-buffer-timeout>
      
      
            <acceptors>
               <!-- Default ActiveMQ Artemis Acceptor.  Multi-protocol adapter.  Currently supports ActiveMQ Artemis Core, OpenWire, STOMP, AMQP, MQTT, and HornetQ Core. -->
               <!-- performance tests have shown that openWire performs best with these buffer sizes -->
               <acceptor name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>
      
               <!-- AMQP Acceptor.  Listens on default AMQP port for AMQP traffic.-->
               <acceptor name="amqp">tcp://0.0.0.0:5672?protocols=AMQP</acceptor>
      
               <!-- STOMP Acceptor. -->
               <acceptor name="stomp">tcp://0.0.0.0:61613?protocols=STOMP</acceptor>
      
               <!-- HornetQ Compatibility Acceptor.  Enables HornetQ Core and STOMP for legacy HornetQ clients. -->
               <acceptor name="hornetq">tcp://0.0.0.0:5445?protocols=HORNETQ,STOMP</acceptor>
      
               <!-- MQTT Acceptor -->
               <acceptor name="mqtt">tcp://0.0.0.0:1883?protocols=MQTT</acceptor>
            </acceptors>
      
      
            <security-settings>
               <security-setting match="#">
                  <permission type="createNonDurableQueue" roles="amq"/>
                  <permission type="deleteNonDurableQueue" roles="amq"/>
                  <permission type="createDurableQueue" roles="amq"/>
                  <permission type="deleteDurableQueue" roles="amq"/>
                  <permission type="consume" roles="amq"/>
                  <permission type="send" roles="amq"/>
                  <!-- we need this otherwise ./artemis data imp wouldn't work -->
                  <permission type="manage" roles="amq"/>
               </security-setting>
            </security-settings>
      
            <address-settings>
               <!--default for catch all-->
               <address-setting match="#">
                  <dead-letter-address>jms.queue.DLQ</dead-letter-address>
                  <expiry-address>jms.queue.ExpiryQueue</expiry-address>
                  <redelivery-delay>0</redelivery-delay>
                  <max-size-bytes>10485760</max-size-bytes>
                  <message-counter-history-day-limit>10</message-counter-history-day-limit>
                  <address-full-policy>BLOCK</address-full-policy>
               </address-setting>
            </address-settings>
         </core>
      </configuration>
      
      

      artemis-user.properties

      guest=guest
      

      artemis-roles.properties

      amq=guest
      

            rh-ee-ataylor Andy Taylor
            zkraus@redhat.com Zdenek Kraus
            Jiri Daněk Jiri Daněk
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: