3 Replies Latest reply on Oct 1, 2005 11:29 PM by neelixx

    Force reloading a servlet in JBoss

    psseshwari

      Hi

      I'm using JBoss 4.0. Is there a way to force reload a servlet in JBoss? I wanted to drop in a modified servlet class file, without restarting the server. When I modify an already deployed class file, JBoss is not picking the latest one. In Tomcat I'm able to force reload it by setting the reload=true in server.xml. What should I do to enable the same in JBoss? Please clarify. I need this asap.

      Thanks,
      Eshwari

        • 1. Re: Force reloading a servlet in JBoss
          raja05

          Two ways AFAIK(although they might end up being the same depending on the way its setup)

          1. Touch your web.xml if the war is unpacked or touch the whole WAR file if packed

          2. Look up the list of completeDeployments method from the MainDeployer JMX MBeanView of the jmx-console. There should be an entry for your war over there. Look up the "WatchURL" in that and touch that file. Thats the trigger that Jboss uses to redeploy a package.

          • 2. Re: Force reloading a servlet in JBoss
            psseshwari

            Hi Raja,

            Thanks for your reploy. What do you mean by "touch that file"? I'm able to see the watch url for my deployed application. Could you please elaborate on this?

            Thanks,
            Eshwari

            • 3. Re: Force reloading a servlet in JBoss
              neelixx

              "Touching" is a unix/linux term. To "touch" a file, means to update it's "lastModified" attribute, without really modifying it.

              If you are running JBoss on Unix or Linux you simply run "touch ". If you are running JBoss on Windows, but you have access to a Linux/Unix server/workstation, you can setup a mount to JBoss, and touch it that way.

              In Windows, the best way to "touch" the web.xml is to open it in notepad, save it, then close it.