6 Replies Latest reply on Nov 9, 2009 8:02 PM by Adrian Mitev

    How do you hot-deploy class files?

    Alex Cougarman Apprentice

      I've heard of hot deployment for Seam apps (without having to redeploy the app). Is it just a matter of copying the .java file to the server? Thanks.

        • 1. Re: How do you hot-deploy class files?
          Adrian Mitev Master

          You deploy your components in WEB-INF/dev and Seam loads them using its own class loader and scans the directory for changes. When you change the class file, seam loads reloads it.

          • 2. Re: How do you hot-deploy class files?
            Alex Cougarman Apprentice

            Thanks, Adrian. Very useful to know. How about the Facelet files (XHTML)? Can those just be dropped into the app and be available to the next page request without a redeploy?

            • 3. Re: How do you hot-deploy class files?
              Arbi Sookazian Master

              read the ref doc...



              You need to be aware of the following limitations:
              • the components must be JavaBean components, they cannot be EJB3 beans (we are working
              on fixing this limitation)
              • entities can never be hot-deployed
              • components deployed via components.xml may not be hot-deployed
              • the hot-deployable components will not be visible to any classes deployed outside of WEB-INF/
              dev
              • Seam debug mode must be enabled and jboss-seam-debug.jar must be in WEB-INF/lib
              • You must have the Seam filter installed in web.xml
              • You may see errors if the system is placed under any load and debug is enabled.
              If you create a WAR project using seam-gen, incremental hot deployment is available out of the
              box for classes in the src/hot source directory. However, seam-gen does not support incremental
              hot deployment for EAR projects.

              JRebel will allow you to hot deploy changes to EJB interfaces soon, but not sure how you can (or should?) use JRebel with Seam special classloader.


              I posted this question recently in the forum and no response AFAIK...



              <core:init debug="true">
              Now, the following files may be redeployed without requiring a full restart of the web application:
              • any facelets page
              • any pages.xml file
              • 4. Re: How do you hot-deploy class files?
                Arbi Sookazian Master

                The fact that entity classes are not hot-deployable is not a big problem b/c those classes typically do not need to be changed very often.


                The lack of EJB3 support is a problem as they do change very often (as do xhtml/JSF files) and this is one of the reasons Seam devs are using WARs instead of EARs (POJOs are hot deployable).


                What is the status of this?: they cannot be EJB3 beans (we are working on fixing this limitation)


                Is there a JIRA for this?  IIRC there was a hot deploy thread a while back and the conclusion was that it's not technically possible to hot deploy EJB 3 components b/c of the proxies that the EJB container generates on the fly.  But apparently this is not true (any longer) as JRebel is about to solve this problem...

                • 5. Re: How do you hot-deploy class files?
                  Adrian Mitev Master

                  Look here. The issue is still hanging.

                  • 6. Re: How do you hot-deploy class files?
                    Adrian Mitev Master

                    And as you can see... 97 votes. Please vote for it!