0 Replies Latest reply on Mar 14, 2017 2:38 PM by weberj

    call a secured EJB from JMX MBean

    weberj

      Hi,

       

      I have an EJB protected with a <method-permission> and <role-name>.

       

      I can call the EJB from a Servlet with <security-constraint> and <auth-method>BASIC, the EJB's getCallerPrincipal() gets the Servlet user.

       

      Now I'd like to call the EJB from a JMX MBean (registered by another @Startup @Singleton EJB).

       

      How can I login with User/pass from within the JMX Bean and call the EJB ?

       

      I tried the same way as from a Java Client, but it looks like org.jboss.naming.remote.client.InitialContextFactory is not available within the server.

       

      javax.naming.NamingException:JBAS011843: Failed instantiate InitialContextFactory org.jboss.naming.remote.client.InitialContextFactory from classloader ModuleClassLoader for Module

       

      Thanks for any hints,

      Juergen