3 Replies Latest reply on Jul 28, 2004 2:19 AM by samchiu

    Automatic reloading of web classes (servlets, etc)

    lauerc

      Hi,

      I have a question regarding classloading and hot deployment of web archives within JBoss and JBoss Web. At the moment we are deploying our applications as exploded archives with a structure like this:

      +jboss
      + server
      +default
      +deploy
      +app.ear
      +META-INF
      +lib
      +app.war
      +META-INF
      +WEB-INF
      +lib
      +classes

      Whenever we want to hot deploy a single servlet class, we are copying the classes or libraries to their destination directories in this structure. I've found out that nothing happend until the application.xml in the ear's META-INF directory has been touched. This makes JBoss redeploy everything - libraries EJBs, SARs and finally the web archive, which kills all existing HTTP sessions and makes a developers live hard, because the only thing i wanted to do is to redeploy one single servlet class and test my change, but so I have to wait until the redeployment of the complete application has finished, after that i have to waste more time to log in and to reach my desired session state again. For example on BEA WebLogic server every class that is deployed in the web archive is automatically reloaded when it changes. Does anybody know a way how to configure the application for JBoss to reach the desired behaviour?

      Best regards,
      Christian

        • 1. Re: Automatic reloading of web classes (servlets, etc)
          lauerc

          Oops, somhow the directory structure which i tryed to explain was destroyed, here my second attempt on that.

          +jboss
          --+server
          ----+default
          ------+deploy
          --------+app.ear
          ----------+META-INF
          ----------+lib
          ----------+app.war
          ------------+META-INF
          ------------+WEB-INF
          ------------+lib
          ------------+classes

          • 2. Re: Automatic reloading of web classes (servlets, etc)
            trajano

            Though this is not really a direct solution to your problem, I hope you would find this a better one.

            We normally do a lot of web app development, and instead of manually trying to do the test cases, we just automate them using HTTPUnit. That way we do not have to worry too much about session setup and such because it just does the script over and over again. Plus its easy enough to add or extend our existing test cses to test other aspects of our code.

            • 3. Re: Automatic reloading of web classes (servlets, etc)
              samchiu

              hi
              I have the similar problem.
              my servlet will generate a new class and compile it run-time, but I can't load this class even the new class already in class path and web-inf/classes. I think that Jboss can't dynamic load class,cos the UnifiedLoaderRespository cached the snapshot class when JBoss startup,and never reload.

              Thank you all in advance