1 Reply Latest reply on Aug 15, 2019 4:29 AM by weberj

    EJB should call Servlet on startup

    weberj

      Hi,

       

      I want an EJB call a Servlet *on the same server* on server startup.

       

      This looks very easy, but is very hard.

       

      @Startup / @Singleton / @PostConstruct is triggered before the http port is up and open, so @PostConstruct hangs forever. Indeed as @PostConstruct never comes back, the server never opens the listen port.

       

      Tried to trigger the EJB from an @WebListener. Same behaviour.

       

      Is there a better way than to trigger in @PostConstruct an EJB Timer that waits a minute or so and then calls the servlet?

       

      Is there a Server-is-up-and-running-Callback?