5 Replies Latest reply on Jul 17, 2012 9:39 AM by Mike Miller

    javax.jms.JMSSecurityException: Unable to validate user: null

    Laura delli Paoli Master

      Hello everybody,

      I'm trying to create a queue using JBoss AS7 and HornetQ.

       

               Properties env = new Properties();

                          env.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY);

                          env.put(Context.PROVIDER_URL, PROVIDER_URL);

       

      // user credential refers to a JBoss ApplicationUser with User,Trainer,Administrator,createTempQueue roles

       

                          env.put(Context.SECURITY_PRINCIPAL, DEFAULT_USERNAME);

                          env.put(Context.SECURITY_CREDENTIALS, DEFAULT_PASSWORD);

                          env.put("jboss.naming.client.ejb.context", true);

               InitialContext ctx = new InitialContext(env);

               qconFactory = (QueueConnectionFactory) ctx.lookup("jms/RemoteConnectionFactory");

                          qcon = qconFactory.createQueueConnection();

                          qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

                          queue = (Queue) ctx.lookup(queueName);

                          qsender = qsession.createSender(queue);

                          msg = qsession.createTextMessage();

                          qcon.start();

       

      but on the createQueueConnection() i get the following error:

       

      30-mag-2012 15.03.17 org.xnio.Xnio <clinit>

      INFO: XNIO Version 3.0.3.GA

      30-mag-2012 15.03.17 org.xnio.nio.NioXnio <clinit>

      INFO: XNIO NIO Implementation Version 3.0.3.GA

      30-mag-2012 15.03.17 org.jboss.remoting3.EndpointImpl <clinit>

      INFO: JBoss Remoting version 3.2.3.GA

      30-mag-2012 15.03.18 org.jboss.ejb.client.remoting.VersionReceiver handleMessage

      INFO: Received server version 1 and marshalling strategies [river]

      30-mag-2012 15.03.18 org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate

      INFO: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@4402a6ff, receiver=Remoting connection EJB receiver [connection=Remoting connection <6a510e39>,channel=jboss.ejb,nodename=dellipaoli]} on channel Channel ID b7ff048c (outbound) of Remoting connection 7df1bd98 to localhost/127.0.0.1:4447

      30-mag-2012 15.03.18 org.jboss.ejb.client.remoting.ChannelAssociation$ResponseReceiver handleMessage

      WARN: Unsupported message received with header 0xffffffff

      javax.jms.JMSSecurityException: Unable to validate user: null

                at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:312)

                at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:780)

                at org.hornetq.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:279)

                at org.hornetq.jms.client.HornetQConnection.authorize(HornetQConnection.java:601)

                at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:684)

                at org.hornetq.jms.client.HornetQConnectionFactory.createQueueConnection(HornetQConnectionFactory.java:131)

                at org.hornetq.jms.client.HornetQConnectionFactory.createQueueConnection(HornetQConnectionFactory.java:126)

                at SimpleSender.init(SimpleSender.java:46)

                at run.main(run.java:24)

      Caused by: HornetQException[errorCode=105 message=Unable to validate user: null]

                ... 9 more