2 Replies Latest reply on Jul 30, 2005 11:16 AM by Scott Stark

    Servlet init() calling secured EJBs


      I have an app which requires that on system startup, various initialisation is performed, which results a) in system delivered data being created, and b) some utility objects being bound into JNDI.

      I am doing this work in the init() method of a servlet which is deployed within my EAR.

      Unfortunately, if I secure my EJBs, then the servlet cannot access them, as it runs under a null user principal. Run-as role doesn't help that.

      I tried doing an explicit client login to the domain in question within the init() method. The login succeeds, but I still get the same null principal errors when it tries to access the secured EJBs.

      Can anyone suggest how I should perform this initialisation in a secured environment? I need to be portable, which is why I have used a servlet init() method up to now.