0 Replies Latest reply on Sep 6, 2005 6:15 PM by ushirshah

    Temporary queue & JAAS Security

    ushirshah

      Hi, I am using Jboss and have configured JAAS authentication. When I try to create a Receiver for the temporary queue I am getting follwoing exception:

      javax.jms.JMSSecurityException: Connection not authorized to subscribe to destination: JMS_TQ8


      When I try to create queue and Topic, my user/passwod gets authenticated and successfully creates queue/topic. Under jbossmq-destinations-service.xml I have my queues and topics configured correctly with the security role. I am not using Message Driven Beans.

      I am having this error for temporaray queue when I tried to createReceiver for the temporary queue. Any idea what might be happening? Without implementing MDB can I use JAAS security for the temporary queue ?

      part of my code:

      try
      {
       Context jndiContext = getInitialContext();
       QueueConnectionFactory ref =
       (QueueConnectionFactory)jndiContext.lookup("ConnectionFactory");
      
       Queue queue = (Queue)jndiContext.lookup("queue/testQueue");
       queueConnection = ref.createQueueConnection();
       QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
       // The temporary queue,
       TemporaryQueue tq = queueSession.createTemporaryQueue();
       queueSender = queueSession.createSender(queue);
       QueueReceiver qr = queueSession.createReceiver(tq);
      }
      catch (Exception e) {
       System.out.println(e.getMessage());
       e.printStackTrace();
      }
      
      


      I am using Jboss 4.0.2.

      Thanks for your help in advance,
      Ushir