EJBAccessException JMS MessageLIstener how to RunAs?

41 views
Skip to first unread message

dt pham

unread,
Mar 12, 2021, 1:03:18 PM3/12/21
to WildFly
When it comes to MDB, the RunAs role on MDB class is working right. However, when creating a custom MessageListener class, how do we allow this class to access secured EJB. I add @RunAs on this class, but it seems not to have any affect while the RunAs on my MDB class is fine. In my custom MessageListener, 
I just simply new InitialContext().lookup("ConnectionFactory") and use this connection to subscribe the JMS topic. The data is coming and then invokes a secured EJB method and got rejected.

dt pham

unread,
Mar 12, 2021, 1:04:48 PM3/12/21
to WildFly
Note that I am running with wildfly 23 and using custom elytron realm for app login

Farah Juma

unread,
Mar 12, 2021, 2:49:04 PM3/12/21
to WildFly
Just to check, have you also configured the messaging-activemq subsystem to make use of your Elytron security domain using the elytron-domain attribute?

dt pham

unread,
Mar 12, 2021, 4:03:36 PM3/12/21
to WildFly
Yes, I do have it. Here is some thing like this for my elytron domain "dtpham"
<subsystem xmlns="urn:jboss:domain:messaging-activemq:13.0">
            <server name="default" >
                <security elytron-domain="dtpham" enabled="true"/>

Reply all
Reply to author
Forward
0 new messages