5 Replies Latest reply on Feb 20, 2008 2:35 AM by rekie

    Restart own application after error

    rekie

      Hi all,

      I hope this is the correct forum to post this question, as it might also fit into the cluster forum, but I won't crosspost it and the problem is not directly connected to clustering.

      We run our app on JBoss AS 4.2.1.GA and as it is in a late beta state I would like to know if there is a way to tell JBoss AS to "restart" the application if it is stuck due to an error it can not recover from alone.

      Right now the solution is to restart the whole server, which is not realy the way to choose in an productive environment and I would like to test a solution on our test cluster.

      So it would be great if anybody can give me a hint or point me to a source where I can find a solution to this problem, as I did not find anything in the Guides, the Wiki or this forums.

      THX a lot
      Reinhard

        • 1. Re: Restart own application after error
          jaikiran

          JBoss allows you to redeploy (i guess that's what you mean by "restart") an application. If your application is deployed in exploded format (http://wiki.jboss.org/wiki/Wiki.jsp?page=ExplodedDeployment) then you can redeploy the application as follows:

          http://wiki.jboss.org/wiki/Wiki.jsp?page=RedeployAnApplicationWhenChangeAFileInAnExplodedDeploymentDirectory

          If your application is deployed as an zipped archive then all you have to do is delete it from the deploy folder and paste a new version (or even the same version) of the application in the deploy folder.

          Right now the solution is to restart the whole server, which is not realy the way to choose in an productive environment


          According to me, redeploying an application is best suited for development environments. I would prefer restarting the server in production environments to avoid any issues.


          • 2. Re: Restart own application after error
            rekie

            Hi jaikiran,

            thank you for your quick response. I know about the deployment of exploded and zipped archives, and we use zipped archives to deploy.

            But deployment was not exactly what I meant, sorry for not communicating this close enough.

            Maybe an example makes it more clear: If a client (browser) selects a page and some parts of this page can not be displayed (eg: a picture is not found, or there is some mistake in the icefaces treefiew...) this is bad for the person wanting that information, but the application is still able to serve other requestes. But if the application throws an error in the backend (eg: an serialisation error or a JNDI lookup fails (thx to your latest blog-entry this is going to happpen far less in future ;) ) the application does not serve any more requests. For that case it would be nice to have a mechanism that puts back the application into a state where it can work as expacted again (like it does right after startup/deployment) WITHOUT having to redeploy the applicatin or restart the server.

            It can very well be that I am asking a realy stupid question here, and if ther is no way to do what I am asking for, just tell me that there is no thing as an "perpetuum mobile" and I will keep redeploying the application or restarting the server.

            Thank you very much
            Reinhard

            • 3. Re: Restart own application after error
              jaikiran

               

              For that case it would be nice to have a mechanism that puts back the application into a state where it can work as expacted again (like it does right after startup/deployment) WITHOUT having to redeploy the applicatin or restart the server.


              Well, this would depend on the application rather than the server. The server would have no idea as to what state is a "clean state" for a particular application. From the server's point of view, to get the application to a clean state, you will have to redeploy the application or restart the server.


              • 4. Re: Restart own application after error
                jaikiran

                Furthermore, since the application knows what's a "clean state", for it to serve the user, it may provide some way (ex: Through your application's admin screens) to bring it back to a workable state.

                • 5. Re: Restart own application after error
                  rekie

                  Hi agian,

                  this helps a lot

                  thx
                  Reinhard