3 Replies Latest reply on Jun 30, 2009 11:38 AM by blabno

    Possible to hot incremental deploy JavaBean in Seam 2.x with EAR?

    asookazian

      I have an exploded EAR that I'd like to hot incrementally deploy JavaBean components with.


      from 2.1.1 ref doc:



      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.

      So is it possible to hot redeploy JavaBean component in an exploded EAR?  If yes, what must I do to enable this?


      Also, this is a very limiting restriction:



      the hot-deployable components will not be visible to any classes deployed outside of WEB-INF/dev

      if you have EJB3 components in your project as well that reference (or are injected into, etc.) the JavaBean components...


      Is this going to be fixed/improved in Seam 3?

        • 1. Re: Possible to hot incremental deploy JavaBean in Seam 2.x with EAR?
          swd847

          The issue is more a Java issue that a seam one. The reason why the components are not visible outside of WEB-INF/dev is because every time a component is changed the classloader is dumped and the classes are re-loaded in a new classloader, this means that according to java they are different classes. Objects outside WEB-INF/dev would see them as different classes and after the first hot deploy would throw ClassCastExceptions every time you tried to inject.


          You can still inject these components into other classes, you just have to make them inherit from an interface in the parent classloader that doesn't change, and use this interface at all injection points.


          • 2. Re: Possible to hot incremental deploy JavaBean in Seam 2.x with EAR?
            asookazian

            So are most (if not all) of the Seam devs who are using hot incremental deploy with JavaBean components on a regular basis only using JavaBean components and no EJB components?


            That way all the components would be located in the WEB-INF/dev directory and would have access to each other at all times, no?

            • 3. Re: Possible to hot incremental deploy JavaBean in Seam 2.x with EAR?
              blabno

              Q1 : yes
              Q2 : entities cannot be hot deployed, action java beans are all in WEB-INF/dev (but not ejbs)


              For early development you can use war and later migrate to ear.