3 Replies Latest reply on Mar 23, 2004 9:20 AM by Scott Stark

    MBean method invocation cleans SecurityAssociation

    Anton Newbie

      Hi All!
      I am using JBoss 3.2.3.
      I am trying to invoke an MBean method from a secured Stateless Session Bean. For example:

      beanMethod() {

      ...
      RMIAdaptor server = ...
      ...
      System.out.println("PRINCIPAL BEFORE MBEAN METHOD CALL = " + SecurityAssociation.getPrincipal())
      server.invoke(...);
      System.out.println("PRINCIPAL AFTER MBEAN METHOD CALL = " + SecurityAssociation.getPrincipal())

      ...

      }

      I am getting two following lines:
      PRINCIPAL BEFORE MBEAN METHOD CALL = user
      PRINCIPAL AFTER MBEAN METHOD CALL = null

      So, MBean method invocation destroys SecurityAssociation!!! And I can not call another secured EJBs in businessMethod() after MBean call.
      HELP ME PLEASE!