1 Reply Latest reply on Aug 6, 2002 4:05 PM by Rafal Piotrowski

    getCallerPrincipal in ejbCreate()

    Marcus Ahnve Newbie

      We have a little problem using EJBContext.getCallerPrincipal() from ejbCreate(). We have the following situation:

      * BeanA calls getCallerPrincipal() from its ejbCreate().
      * BeanB does not.

      If BeanA.create() is called first, we get IllegalStateException, no security context set.

      If BeanB.create() is called first however, BeanA.create() works just dandy.

      I'm a little unsure what is the correct behavior here. Reading the spec at page 80, it says that getCallerPrincipal should be callable from ejbCreate(). However, on page 436 it says that it should only be accessed from 'business methods'.

      Any help greatly appreciated.