14 Replies Latest reply on Apr 11, 2013 4:58 AM by paulcooper

    JBOSS HOT deployment

    ashishjoshi106

      Please tell me the steps of hot deployment in jboss so that if i upload a java class file into the war it automatically update.

        • 1. Re: JBOSS HOT deployment
          peterj

          If you change a class file, then you must also "touch" the web.xml file to get JBoss AS to redeploy the app. I usually make an innocuous change, such as adding an empty line (or removing it on the second redeploy!) and saving it.

          • 2. Re: JBOSS HOT deployment
            ashishjoshi106

            its not correct answer hot deployment means if i add a class file in jboss application server then it will automatically update itself.

            • 3. Re: JBOSS HOT deployment
              peterj

              JBoss AS does not have the ability to replace a single class within an application. The only "hot deploy" available in JBoss is when an application is either deployed or redeployed without restarting JBoss AS. And the only way to get JBoss AS to redeploy an "exploded" war is to touch the web.xml file. Of course, if you have a war file, then updating the war file will also cause an application redeploy.

              • 4. Re: JBOSS HOT deployment
                ashishjoshi106

                So in jboss there is no option to update a single class file in incremental deployment of war, we can only add a class file and restart the jboss.

                • 5. Re: JBOSS HOT deployment
                  peterj

                  >>there is no option to update a single class file in incremental deployment of war

                  That is correct.

                   

                  >> we can only add a class file and restart the jboss.

                  That is not correct. As I already stated, JBoss AS will redeploy an application while it (JBoss AS) is running. In other words, youi do not have to restart JBoss AS. It all depends on how your applicaiton is deployed:

                  a) If you deployed your application as a war file, when you update the war file the application is redeployed.

                  b) If you deployed your application as an exploded war (an unpacked war), then you can redeploy the application by touching the web.xml (that is, by changing it last modified timestamp). In Linux you can use the touch command, in Windows edit the web.xml and add a space or blank line or make some other inncuous change and save it.

                  Both mechanisms are known as hot deployment. Also note that this is the default behaviour - there is a mechanism to turn off hot deployment.

                  • 6. Re: JBOSS HOT deployment
                    ashishjoshi106

                    Thank You so much

                    • 7. Re: JBOSS HOT deployment
                      paulcooper

                      I have a exploded war setup for my application and even though I have updated a class and touched (windows method) the web.xml file the old cached class file is still being used. I assume I have a setup with the hot deployment feature turned off. Where is this set and how do I turn it on?

                      • 8. Re: JBOSS HOT deployment
                        wdfink

                        That depends on the used JBoss version. Please provide the version you use.

                        • 9. Re: JBOSS HOT deployment
                          paulcooper

                          According to jmx-console the version is 5.1.0 GA

                           

                          Paul

                          • 10. Re: JBOSS HOT deployment
                            wdfink

                            See server/<profile>/deploy/hdscanner-jboss-beans.xml

                            you will find the scan period and other parameters here.

                            If you use the unchanged configuration the scanner is enabled by default.

                            You can find more information in this wiki

                            • 11. Re: JBOSS HOT deployment
                              paulcooper

                              Thanks, Wolf-Dieter.

                               

                              I have found that my hdscanner-jboss-beans.xml is missing which is how the hot deploy is meant to be turned off. Do you have or can you point me at a copy of the full file so I can build my own copy. All I can find on the web is the snippet that is edited and I do not have another JBoss server setup to copy it from.

                               

                              Regards,

                               

                              Paul

                              • 12. Re: JBOSS HOT deployment
                                wdfink

                                See the download page and scroll down to the 5.1 version do you have as the file might be not the same for different versions.

                                • 13. Re: JBOSS HOT deployment
                                  wdfink

                                  Also another option is if you have several profiles (different directories in the 'JBOSS_HOME/servers' directory), you might simple copy the file from a different profile.

                                  • 14. Re: JBOSS HOT deployment
                                    paulcooper

                                    Wolf-Dieter,

                                     

                                    There are no other profiles. I also did a file search to see if that file existed elsewhere.

                                     

                                    Thanks for the link. I now have the joy of trying to get round the download blocking proxy server my company uses. :-(

                                     

                                    Regards,

                                     

                                    Paul