title: Weblogic Message Driven Bean reading from a secured queue @RunAs does not work
body: <p>I have a MDB very simple which works fine as long as the queue from where it reads messages is not secured</p>
  
  <p>After I secure the Queue with a username it can;t read messages anymore</p>
  
  <pre><code>@MessageDriven(mappedName = "DistributedQueueTest")
  
  public class MdbReceiver implements MessageListener {
  @Resource
  private MessageDrivenContext mdc;
  
  @Override
  public void onMessage(Message inMessage) {
  TextMessage msg = null;
  try {
  msg = (TextMessage) inMessage;
  System.out.println("Test MdbReceiver Message received : " + msg.getText());
  } catch (JMSException e) {
  e.printStackTrace();
  mdc.setRollbackOnly();
  }
  }
  
  }
  </code></pre>
  
  <p>I tried with all kind of @RunAs annotations
  <code>@weblogic.jws.security.RunAs(role="Joan",mapToPrincipal="ccc_user")</code> where ccc_user is alowed to read messages from the queue</p>
  
  <p>import javax.annotation.security.RunAs;
  <code>@RunAs("SomeRole")</code> gives me an error on deployment
  Unable to deploy EJB: MdbReceiver from mdbReceiver.jar: Expected role in mapping</p>
  
  <p>Any idea how can i do this with annotations ? I tried even without annotations
  ...same the exeption in weblogic console is </p>
  
  <p><code>weblogic.jms.common.JMSSecurityException: Access denied to resource: type=&lt;jms&gt;, application=UNIV_REC_Module, destinationType=queue, resource=DistributedQueueTest, action=receive</code></p>
  
  <p>Thank you</p>