1 Reply Latest reply on Jan 5, 2004 9:58 AM by mandar

    JMS SecurityException

    mandar Newbie

      Hi,
      I have the following entries related to a Queue. A stateless session bean writes messages to the queue and a MDB gets these messages

      ejb-jar.xml

      This setting is done at the bean level
      -----------------
      <security-identity>
      <![CDATA[This method must run as a role that has permissions to write to the queue]]>
      <run-as>
      <![CDATA[This method must run as a role that has permissions to write to the queue]]>
      <role-name>mpublishers</role-name>
      </run-as>
      </security-identity>
      -------------------

      jbossmq-state.xml
      -----------------------

      pub1
      pub1


      pub1

      -------------------------

      Queue definition file


      <!-- Queue used by Store and Forward messages -->


      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager
      <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager





      queue/jms.StoreMessages





      I get this exception when I try to send a message to the queue

      javax.jms.JMSSecurityException: Connection not autorized to addMessages to destination: StoreMessages
      org.jboss.mq.security.ServerSecurityInterceptor.addMessage(ServerSecurityInterceptor.java:160)
      at org.jboss.mq.server.TracingInterceptor.addMessage(TracingInterceptor.java:234)
      at org.jboss.mq.server.JMSServerInvoker.addMessage(JMSServerInvoker.java:137)
      at org.jboss.mq.il.jvm.JVMServerIL.addMessage(JVMServerIL.java:137)
      at org.jboss.mq.Connection.sendToServer(Connection.java:1243)
      at org.jboss.mq.SpySession.sendMessage(SpySession.java:699)
      at org.jboss.mq.SpyQueueSender.internalSend(SpyQueueSender.java:118)
      at org.jboss.mq.SpyQueueSender.send(SpyQueueSender.java:68)
      at net.ussouth.jms.ejb.ssb.TxnReqMessageStorerBean.storeMessage(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)


      What am I missing ?

      Do I need any entries in jboss.xml ?

      What kind of entries can be placed in the section DurableSubscriptions in jbossmq-state.xml file ? Where can I find the DTD for this file ?


      Thanks for your help.

      Regards
      Mandar