6 Replies Latest reply on Dec 23, 2009 10:59 AM by Alexander Lengson

    JBoss 5.0.1: Call secured EJB from MDB annotated with @RunAs

    Alexander Lengson Newbie

      Hello All,


      I am trying to invoke my EJB secured with @RolesAllowed annotation from the onMessage() method of MDB. EJB is injected into MDB.

      I added @Runas("myrole") annotation to the MDB, but on the line where EJB method is invoked, I get EJBSecurityException with the message "Invalid User"


      I've seen number of claims on JIRA here regarding similar topics, but they are closed/fixed and late enough.


      The same approach works well when I invoke the secured EJB from the servlet annotated with @RunAs. EJB is JNDI looked up in that case.


      Is that still a bug in MDB or I am missing a point?