title: Getting an error "Cause: AMQ119031: Unable to validate user" in Spring-Boot app
body: <p>I'm getting the following error when trying to connect to ActiveMQ Artemis Queue deployed on JBoss EAP 7.1. </p>
  
  <blockquote>
    <p>Error: DefaultMessageListenerContainer: Could not refresh JMS
    Connection for destination 'jms/queue/QueueA' - retrying using
    FixedBackOff{interval=5000, currentAttempts=139,
    maxAttempts=unlimited}. Cause: AMQ119031: Unable to validate user</p>
  </blockquote>
  
  <p>Here is the code I'm using:</p>
  
  <pre><code>@Bean public DefaultMessageListenerContainer myFactory() throws NamingException { 
     DefaultMessageListenerContainer listenerContainer = new DefaultMessageListenerContainer();
     listenerContainer.setConnectionFactory(getConnectionFactory());
     listenerContainer.setDestinationName("jms/queue/QueueA");
     listenerContainer.setMessageListener(new MessageReceiver());
     return listenerContainer; 
  }
  
  private ConnectionFactory getConnectionFactory() throws NamingException { 
     final Properties env = new Properties();
     env.put(Context.INITIAL_CONTEXT_FACTORY, org.wildfly.naming.client.WildFlyInitialContextFactory); 
     env.put(Context.PROVIDER_URL, "http-remoting://localhost:8080"); 
     env.put(Context.SECURITY_PRINCIPAL, "Username"); 
     env.put(Context.SECURITY_CREDENTIALS, "Password"); 
     InitialContext ic = new InitialContext(env); 
     return (ConnectionFactory) ic.lookup("jms/RemoteConnectionFactory");
  }
  </code></pre>