JMSSecurityException When Trying To Cache And Reuse Weblogic Initial Context To A Protected JMS Resource

(Doc ID 1618883.1)

Last updated on MAY 05, 2017

Applies to:

Oracle WebLogic Server - Version 10.3.4 and later
Information in this document applies to any platform.

Symptoms

Looking up a JMS resource which is protected by a user role, and sending messages to it with InitialContext parameters

and "caching" the InitialContext in a static variable of a helper class.

Using this helper class from a webapp, in the first run of the webapp servlet/JSP the JMS send() operations (even multiple ones) are successful.

In subsequent runs of the webapp servlet/JSP, the sending fails with error:

Caused By: weblogic.jms.common.JMSSecurityException: Access denied to resource: type=, application=SystemModule-0, destinationType=queue, resource=jms/q0, action=send
 at weblogic.jms.common.JMSSecurityHelper.checkPermission(JMSSecurityHelper.java:162)
[...]
 at weblogic.jms.client.WLProducerImpl.send(WLProducerImpl.java:970)
 at test.jms.JmsUtility.sendJmsRequest(JmsUtility.java:48)
 at jsp_servlet.__index._jspService(__index.java:81)
 at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
[...]

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms