4 Replies Latest reply on Jul 3, 2013 1:21 AM by Sandeep M

    javax.jms.JMSSecurityException: HQ119031: Unable to validate user: sandeep

    Sandeep M Newbie

      Hi I am trying to get create connection by giving the following line

              1.    props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.remote.client.InitialContextFactory");

              2.    props.put(Context.SECURITY_PRINCIPAL, "sandeep");


              3.    props.put(Context.SECURITY_CREDENTIALS, "password");

              4.   props.put(Context.PROVIDER_URL, "remote://localhost:4447");


              5.    Context ctx = null;

              6.    ctx = new InitialContext(props);


              7.    ConnectionFactory objQueueConnectionFactory = (ConnectionFactory) ctx.lookup("jms/RemoteConnectionFactory");

              8.   Queue queue = (Queue) ctx.lookup("queue/examplename");


              9.   connection = objQueueConnectionFactory.createConnection("sandeep","password");


      The code running successfully upto line number 8 (By keeping log statments i have debugged)


      But when coming to line number 9 it is giving me the following error:


      javax.jms.JMSSecurityException: HQ119031: Unable to validate user: sandeep

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

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

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

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

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

          at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:107)

          at com.ge.trans.testframework.mq.CopyOfPTPPutMessageHeaderForSelector.main(CopyOfPTPPutMessageHeaderForSelector.java:58)

      Caused by: HornetQException[errorType=SECURITY_EXCEPTION message=HQ119031: Unable to validate user: sandeep]

          ... 7 more


      I have also added the user by running add-user.bat and added user with the following details:


      What type of user do you wish to add?

      a) Management User (mgmt-users.properties)

      b) Application User (application-users.properties)

      (a): b


      Enter the details of the new user to add.

      Realm (ApplicationRealm) :

      Username : sandeep

      Password :

      Re-enter Password :

      What roles do you want this user to belong to? (Please enter a comma separated l

      ist, or leave blank for none)[guest]: guest

      Is this new user going to be used for one AS process to connect to another AS pr


      e.g. for a slave host controller connecting to the master or for a Remoting conn

      ection for server to server EJB calls.

      yes/no? yes


      and the user added successfully...


      Please help me in this regard....