8 Replies Latest reply: Mar 19, 2013 7:51 AM by gimbal2 RSS

    Web application with capable of auto update

    Dorairaj
      Hi All,

      I have been developing the webapplications using struts (J2ee Technology) and i have developed few web applications and send to the production. now i want to add autoupdate capability of the application, means if any changes was made jsp/action class then application must have capability of updatin the new code.

      is my thought/requirements come in reality?

      Can anyone suggest/recommend the approach.



      Thanks in advance
        • 1. Re: Web application with capable of auto update
          gimbal2
          Seems like you're looking for an ORM solution. Research JPA (Java Persistence API).

          NOTE: using any ORM solution means changing all your database related code. There is no quick fix.
          • 2. Re: Web application with capable of auto update
            Dorairaj
            Thanks for you quick response,

            I will anaylize JPA (Java Persistence API) and come back with result

            Thanks you soo much
            Right time, right suggestion will changes others life simple
            • 3. Re: Web application with capable of auto update
              Dorairaj
              This seems JPA is ORM tool which can be used to interact with database, then how can it relates to the Jsp/Action class update

              Edited by: Dorairaj on Mar 18, 2013 7:18 PM
              • 4. Re: Web application with capable of auto update
                gimbal2
                rubs eyes

                Wow, I totally read your question wrong. My apologies.

                Note that this is not a Struts forum and Struts is not a JEE technology; its a framework built by Apache, not Oracle. You should look for a Struts forum for more direct answers. But reading your question again I think you're talking about what is called "hot swapping" code; you have a version of the web application running and when you make changes in your code you see these changes in the running application without having to restart the server. Am I correct this time? If so: did you try starting the server in debug mode? How to do that depends on what IDE you're using, you should google it.

                Another name for this is "hot deployment", you may want to google that in combination with struts.
                • 5. Re: Web application with capable of auto update
                  Dorairaj
                  Thank you
                  Struts is not a JEE technology; its a framework built by Apache.
                  I agree, but given as example,consider servelts are example now.

                  you have a version of the web application running and when you make changes in your code you see these >>changes in the running application without having to restart the server. Am I correct this time?
                  Yes you are correct!!.. Thanks

                  If so: did you try starting the server in debug mode? How to do that depends on what IDE you're using, you >>should google it.
                  I am talking about the appliction running in production. What is the relation of IDE and debug mode

                  Can you please elobarate!!..

                  Once again my requirement is , Jsps and servlets are packed into war(app version 1.0) and sent customer environment ,
                  The application is running at customer place, now couple of servlets which was packed in app version 1.0, have been added new functionalites and packed into war(app version2.0).

                  I need to add capability of updating the version2.0 with replacement of version1.0 which is at client place. How can i do this

                  Do i need to container help or any other third party tools can be used for this

                  I am using Tomcat7

                  Hope i explained detail

                  Thanks
                  Dorairaj
                  Java TeamLead
                  • 6. Re: Web application with capable of auto update
                    gimbal2
                    Dorairaj wrote:
                    I am talking about the appliction running in production.
                    Well then it doesn't make sense to want to do that, I was assuming you were talking about your development environment. You are always free to just deploy a new war/ear to the server and it will be reloaded, but if any how many times that succeeds really depends on the server and your application. Deployments to production should be handled with care.

                    To illustrate how it happens in my company

                    1) a hudson build server is used to create a new release version (which is done using Maven)
                    2) a script on the production server does the following when executed

                    - downloads the newly created ear
                    - after a set period of time (say 10 minutes), it stops the server. During this time a message is shown in the application that it is going down and people should finish up their work
                    - the server stops
                    - the newly built ear is deployed to the server (simply overwriting the old one)
                    - any database change scripts that still need to be executed are executed
                    - if all that succeeds, the server is started again

                    That is how much care we took - everything is automated.
                    • 7. Re: Web application with capable of auto update
                      Dorairaj
                      Thanks your detailed information, now i have understood!!..

                      But still my idea is little far from this discussion, Why can't we give a module/function ( typically AutoUpdate) to the user in application and this module will search for new versions of the code(db scripts if any) by connecting the website where we manage the build information and then it took update from website without manual intervention.

                      Note: This is my idea, can go ahead with this or if i get any issues with this.
                      • 8. Re: Web application with capable of auto update
                        gimbal2
                        Dorairaj wrote:
                        Thanks your detailed information, now i have understood!!..

                        But still my idea is little far from this discussion, Why can't we give a module/function ( typically AutoUpdate) to the user in application and this module will search for new versions of the code(db scripts if any) by connecting the website where we manage the build information and then it took update from website without manual intervention.

                        Note: This is my idea, can go ahead with this or if i get any issues with this.
                        Most servers actually have such an administration module. But you'd have to check the manual of your server, its not a programming related question.