1 2 Previous Next 15 Replies Latest reply on Jul 9, 2009 1:27 PM by Ondrej Medek

    Re-deployment questions?

    Dickson Lui Newbie

      Hi all,

      I have several questions about the deployment of a web application. Thanks for any help.

      1. If I want to re-deploy the web application directly, I know that I just put the new war file in the "deploy" folder. It can re-deploy itself. My question is how about the transaction is handled during the deployment. Does JBoss AS 5.0 will wait all connection/request to finish first and then stop the new request; then do deployment. Please help to clarify the deployment flow.

      2. If I use the other way to re-deploy the web application - undeploy it first and deploy it with the new version, how does JBoss handle the transaction/request during undeploy?

      3. Also, if any user browse that web page in the stopped web application, they will 404 page not found. Is there other method/handling better to show the specific stopped web application is not available ( a message page )?

      Thanks in advance for anyone's help.

        • 1. Re: Re-deployment questions?
          Peter Johnson Master

          1) The existing sessions will most likely receive errors and the users will have to redo their work.

          2) Same as 2.

          3) There is no such automatic mechanism. You could, however, replace the existing WAR file with another using the same context which then provides the "sorry, but the site is down" page.

          • 2. Re: Re-deployment questions?
            Dickson Lui Newbie

            Thanks Peter again.

            About the question 3, does JBoss AS 5.0 make a custom 404 webpage for a web application? Just like Apache, you can set a custom webpage under a directory whenever it hits the 404 error code.

            Has JBoss this feature? (Can we set it in web.xml?)

            • 3. Re: Re-deployment questions?
              Brett Cave Newbie

              Yes (this is for Jboss 4.2, not sure if it is exactly the same in AS5)

              This can be configured on a per-application basis.

              In web.xml of the WAR, add
              <error-page>
              <error-code>404</error-code>
              /error/404.html
              </error-page>

              You can do the same for each code, and there is problably a way to configure global error message.

              location must start with / and / is relative to the context root of your webapp.

              (So if app is deployed to /myApp/ you will need /myApp/error/404.html)


              • 4. Re: Re-deployment questions?
                Brett Cave Newbie

                seems the forum stripped tags. /error/404.html is wrapped by location tags /error/404.html

                • 5. Re: Re-deployment questions?
                  jaikiran pai Master

                   

                  "brettcave" wrote:
                  seems the forum stripped tags


                  While posting logs or xml content or code, please remember to wrap it in a code block by using the Code button in the message editor window. Please use the Preview button to ensure that your post is correctly formatted.

                  • 6. Re: Re-deployment questions?
                    Peter Johnson Master

                    You should also be able to define global HTTP error code pages by defining them in server/xxx/deployers/jbosssweb.deployer/web.xml.

                    • 7. Re: Re-deployment questions?
                      Dickson Lui Newbie

                      Thanks again.

                      If I define global HTTP error code page, that is for all applications. My objective is the defined http error code page only for those application which is stopped for maintenance (deploy or other else), not all applications so that the end user can get the proper notice/message about that application is under maintenance or not available.

                      Any method define the http error code page for stopped application?

                      • 8. Re: Re-deployment questions?
                        Dickson Lui Newbie

                        Hi all,

                        As my original question, I want to deploy the new version of web application nicely so that the end user would not suddenly get the error during their work on the web application. Does JBoss AS 5.0 have graceful stop and startup feature that is the same as Apache do.
                        If grace restart apache, it will wait all the existing session finish the request and don't accept the new request; then restart apache at all.

                        • 9. Re: Re-deployment questions?
                          Dickson Lui Newbie

                          Hi everyone,

                          For my original question, I want to inform end user with a message (webpage) about the upgrading of web application whenever the end user access the web application.

                          Does anyone have good idea to accomplish this objective? If we set the error webpage for 404 only in that web application, it won't work when stop/undeploy that web application. If we set the error webpage 404 globally in the whole JBoss, it may lead to wrong message to other application users.

                          My main question is how to nice upgrade the web application, not just undeploy or delete that web application.

                          Thanks anyone's help.

                          • 10. Re: Re-deployment questions?
                            Dickson Lui Newbie

                            Can anyone help for this issue?

                            Or

                            Any idea to implement it?

                            thanks for any help

                            • 11. Re: Re-deployment questions?
                              jaikiran pai Master

                               

                              Any idea to implement it?


                              Okay, let me give this a try.

                              For my original question, I want to inform end user with a message (webpage) about the upgrading of web application whenever the end user access the web application.

                              Does anyone have good idea to accomplish this objective? If we set the error webpage for 404 only in that web application, it won't work when stop/undeploy that web application. If we set the error webpage 404 globally in the whole JBoss, it may lead to wrong message to other application users.


                              I think this redirection to a custom maintenance page should happen outside the application server, for exactly the reasons you noted above. I guess it could be done by setting up some Apache configurations[1] outside the JBoss AS which will redirect the request to a different URL so that the original request never reaches the JBoss server.

                              [1] I have no clue how this can be done, since i have not looked into such configurations. I might be wrong too, about this being possible with some "Apache configuration"


                              • 12. Re: Re-deployment questions?
                                Dickson Lui Newbie

                                Does Anyone have better idea to implement my task? Thanks in advance.

                                • 13. Re: Re-deployment questions?
                                  liangfa lei Newbie

                                  Why not using cluster with more than one JBoss instance?

                                  You can upgrade your app easily in cluster By disabling one node and upgrading it then enabling it.

                                  • 14. Re: Re-deployment questions?
                                    Dickson Lui Newbie

                                    Thanks for Allen's advice.

                                    I am new user for JBoss and still study to use it. My first step is to setup a simple environment that achieve all I need. Then, further step is HA (cluster, failover,...etc). I spent a little bit time to read about the cluster of JBoss. The documentation is not clear to show the steps to setup the clustering. I hope JBoss can have a simple clustering setup example steps by steps.

                                    If you have simple steps to setup simple clustering, please let me know. Thanks.

                                    1 2 Previous Next