4 Replies Latest reply on Mar 5, 2004 11:26 AM by oz59

    Delay HTTP access until web app full deployed

    bgw2

      I'm using JBoss 3.0.7 with Jetty...

      Is there some way to disable HTTP access to any
      content until a web application is fully finished
      deploying ?

      What I'm finding is that I can access web pages, JSPs, etc
      in my web app very soon after it starts deploying in
      JBoss. But I'm initializing some background data in a
      servlet that's loaded on startup, and I'm finding that
      people can access JSPs before this data is finished
      being initialized, causing NullPointerExceptions and
      other nastiness. So I'd like to be able to disallow access
      to the JSPs until this initialization is done (and I'd like
      to avoid having to put checks all over my code on some
      kind of "initialized" flag).

      I tried to do the simple (dumb) thing, making the
      jbossweb MBean "depend" on the MBean for the WAR
      file that's being deployed, but (as I expected) this
      is a circular dependency - it's jbossweb
      that deploys the WARs in the first place.

      Thanks in advance for any advice,

      Bruce

        • 1. Re: Delay HTTP access until web app full deployed
          mpalicka

          Hello, I have exactly the same problem and could not find any solution so far.

          • 2. Re: Delay HTTP access until web app full deployed
            mpalicka

            This is an answer I got from the [jetty-support] mailing list:

            ----- Original Message -----
            From: Greg Wilkins
            To: jetty-support@yahoogroups.com ; michal.palicka@cleverlance.com
            Sent: Wednesday, July 30, 2003 8:58 AM
            Subject: Re: [jetty-support] JBoss/Jetty: Servlet Not Initialized

            Unfortunately this is not possible with the standard
            JBoss deployer.

            With standard Jetty, you could simply not start your listeners
            until the contexts were configured.

            You should probably raise your concern on jboss-dev - so that
            they can see that users want this feature.

            cheers

            --
            Greg Wilkins<gregw@mortbay.com> Phone/fax: +44 7092063462
            Mort Bay Consulting Australia and UK. http://www.mortbay.com


            michal_palicka wrote:
            > Hello,
            > I have a problem with Jetty running as a servlet container in JBoss
            > (3.0.4). When I start the application server, the Jetty (JBossWeb)
            > service is deployed and started before my web applications (servlets)
            > get initialized. As soon as Jetty starts, it accepts client requests.
            > But servlets are not initialized yet and I
            > get "javax.servlet.UnavailableException: Servlet Not Initialized"
            > errors.
            > Is it possible to configure Jetty/JBoss so that it will wait for all
            > web apps to initialize first and then starts accepting incoming
            > requests?
            > Thanks in advance
            > mp.

            • 3. Re: Delay HTTP access until web app full deployed
              urddd

              Has anyone found a solution for this problem?

              • 4. Re: Delay HTTP access until web app full deployed

                Greetings.

                Until your ideal solution surfaces, you might want to go w/ a Filter. Granted, it's not as elegant as a declarative type solution, but at least the "initialized" checks/flags would be cleanly separated in one place.

                cheers.