5 Replies Latest reply on Mar 10, 2010 2:16 AM by Dmitry Egorov

    EJB3 @SecurityDomain and @RunAs or @RunAsPrincipal not worki

    Carsten Fregin Newbie

      Could someone show me, how to use @RunAs or @RunAsPrincipal?
      My try:


      public class CustomerControllerBean implements CustomerController{
       @PersistenceContext EntityManager em;
       public void createCustomer(String name){
       ...create user...

      JMX Bean
      @Service (objectName="myjndi:service=testapplication")
      public class TestApplicationMBean implements TestApplication{
       @EJB CustomerController customerController;
       public String testAccess(String username){

      The access to my SessionBean is only working, if I make a login with the LoginContext with a valid user/password. My intention is to create AdminUsers through a JMX bean. Therefore, I have to permit some functions for the JMX-Bean. I do get "Authentication failure, Password Incorrect/Password Required" errors. I examined a little bit the workflow and see, that there is no principal set. (null)

      Could it be, that @RunAs is not working in the current release?
      JBoss version: 4.0.3SP1