Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7514627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:33:16+00:00 2026-05-30T00:33:16+00:00

I have a MDB very simple which works fine as long as the queue

  • 0

I have a MDB very simple which works fine as long as the queue from where it reads messages is not secured

After I secure the Queue with a username it can;t read messages anymore

@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();
}
}

}

I tried with all kind of @RunAs annotations
@weblogic.jws.security.RunAs(role="Joan",mapToPrincipal="ccc_user") where ccc_user is alowed to read messages from the queue

import javax.annotation.security.RunAs;
@RunAs("SomeRole") gives me an error on deployment
Unable to deploy EJB: MdbReceiver from mdbReceiver.jar: Expected role in mapping

Any idea how can i do this with annotations ? I tried even without annotations
…same the exeption in weblogic console is

weblogic.jms.common.JMSSecurityException: Access denied to resource: type=<jms>, application=UNIV_REC_Module, destinationType=queue, resource=DistributedQueueTest, action=receive

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T00:33:18+00:00Added an answer on May 30, 2026 at 12:33 am

    If you annotate your MDB as follows it should work:

    @MessageDriven(name = "MdbReceiver", mappedName = "DistributedQueueTest")
    @DeclareRoles({"Loan"})
    @RolesAllowed("Loan")
    public class MdbReceiver implements MessageListener {
    ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MDB (Message driven bean) that receives messages with String which represent
It's simple: I have an MDB and an EJB that sends messages to a
I have a huge access mdb file which contains a single table with 20-30
I have to read data from mdb-files using c++ but I'm having trouble getting
I have faced a very strange situation here. I am accessing database (MDB) through
I have an MS-Access mdb file that I need to import data from into
I have an EAR application which contains an MDB and a WAR. In this
I have an MDB that listens on a queue. Whenever it recieves a message,
I have a form which is submitted to a PHP page. The data from
I have an mdb which used to contain a bunch of linked tables. These

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.