13 Replies Latest reply on Feb 26, 2008 12:19 AM by Pete Muir

    Hot Deployment of Seam Projects.

    Tony Herstell Master

      In Pete's Blog he talks about Hot Deployment of Seam and how great it would be to have it work for an Ear project etc.


      I can assure you its possible (using MyEclipse) and I have been doing it for over a year.


      The only annoyance was Seam runtime noticing some files have changed and auto-loading them (again)... there is no way to switch this off it seams.


      It was actually quite simple to set up.. check out previous posts and/or the MyEclipse forums for previous posts of mine.


      Tony.

        • 1. Re: Hot Deployment of Seam Projects.
          Damian Harvey Apprentice

          Tony,


          It's the EJB3 components (eg. Entity Beans, SLSB, etc) that don't hot deploy (see chapter2.8 of the ref doc). Normal POJOs inside EARs hot deploy fine.


          Or do you have EJB3 stuff hot deploying?


          Making hot deploy work for EJB3 components is covered by JIRA 2198


          Cheers,


          Damian.

          • 2. Re: Hot Deployment of Seam Projects.
            Tony Herstell Master

            All my project deploys (exploded deployment).


            Its an ear, with a Jar and a War.



            No Ant script to built it.. I just point MyEclipse at the server and leave MyEclipse to sort it all out.


            I have to have the projects set up correctly but after thats its great!


            SOoooo productive!

            • 3. Re: Hot Deployment of Seam Projects.
              Tony Herstell Master

              Typical Entity..



              @SuppressWarnings("serial")
              @Entity
              @Name("bookingResourceWithHours")
              @DiscriminatorValue("WithHours")
              public class BookingResourceWithHoursRange extends BookingResource implements Serializable {
              
                   private int requestedStartHour;
                   private int requestedStartMinute;
                   private int requestedEndHour;
                   private int requestedEndMinute;
              




              Typical Controller



              @SuppressWarnings("serial")
              @Stateful
              @Name("bookingController")
              @Conversational
              public class BookingControllerImpl implements BookingController, Serializable {
              
                   /*
                    * Inject and leverage the Seam Logger.
                    */
                   @Logger
                   private Log log;






              I ampretty sure its EJB3.. to me it's just Seam!


              • 4. Re: Hot Deployment of Seam Projects.
                Pete Muir Master

                So you can change the signature of a method/class/interface, and these changes will be seen immediately in the app without having to restart the application (restart hibernate etc.) And the same for entites? I don't actually believe this is possible in JBoss/Hibernate atm ;-)

                • 5. Re: Hot Deployment of Seam Projects.
                  Pete Muir Master

                  And with Seam debug on or off?

                  • 6. Re: Hot Deployment of Seam Projects.
                    Gavin King Master

                    So you can change the signature of a method/class/interface, and these changes will be seen immediately in the app without having to restart the application (restart hibernate etc.) And the same for entites? I don't actually believe this is possible in JBoss/Hibernate atm ;-)

                    No, its not possible. Perhaps MyEclipse just forces a restart of the whole web app.

                    • 7. Re: Hot Deployment of Seam Projects.
                      Tony Herstell Master

                      Changing the messages file and the faces-config is not handled immediately so I have to stop server (one click) and re-start server (one click). (Probably the same for other config files but these are rarely ever changed).


                      Changing a method sig causes MyEclipse to throw up a warning and you can carry on, quit, or re-start the server so.... I click stop server (one click) and then start server again (one click).


                      99% of the time I am altering the code inside a bean, debugging!!!! OR fiddling with a XHTML file and in these cases I just change the code/xhtml and just carry on.


                      Now, the Seam team, made a change while back that auto re-loads the xhtml and this is quite annoying as the page gets reloaded often right when I am in the flow...


                      Sine I only get 2 days a week coding (the rest of the time I am helping build the Equestrian center) time is very important to me! (and this includes weekends)


                      • 8. Re: Hot Deployment of Seam Projects.
                        Pete Muir Master

                        Tony Herstell wrote on Feb 18, 2008 08:07 PM:


                        Changing a method sig causes MyEclipse to throw up a warning and you can carry on, quit, or re-start the server so.... I click stop server (one click) and then start server again (one click).



                        Right, so this is what we're talking about - Seam gives you the ability to change the signature of a class without restarting the server.


                        What the blog was about (which I think is very cool) is that JBossTools sets all this up for you. And to give credit where credit is due the hot code replace, and hot xhtml replace is part of Eclipse/Facelets respectively - what MyEclipse does is just tie it together.


                        I have no idea what you mean by


                        Now, the Seam team, made a change while back that auto re-loads the xhtml and this is quite annoying as the page gets reloaded often right when I am in the flow...


                        Do you mean the ant explode which copies files around - easy to turn off in your project builder settings.

                        • 9. Re: Hot Deployment of Seam Projects.
                          Gavin King Master

                          Right, so this is what we're talking about - Seam gives you the ability to change the signature of a class without restarting the server.

                          Not just the signature, but also all the metadata (in annotations).


                          Much cooler.

                          • 10. Re: Hot Deployment of Seam Projects.
                            Siarhei Dudzin Apprentice

                            Btw, I've noticed EntityQuery also can't be hot deployed (it looks like a pojo at first...), is it just me?

                            • 11. Re: Hot Deployment of Seam Projects.
                              Gavin King Master

                              Btw, I've noticed EntityQuery also can't be hot deployed (it looks like a pojo at first...), is it just me?

                              It's just you. :)

                              • 12. Re: Hot Deployment of Seam Projects.
                                Siarhei Dudzin Apprentice

                                I will triple check but I always had troubles hot deploying the entity query.


                                Btw is there anyway to get a list of all my posts like you could do with the old forum?

                                • 13. Re: Hot Deployment of Seam Projects.
                                  Pete Muir Master

                                  Siarhei Dudzin wrote on Feb 21, 2008 07:44 PM:


                                  Btw is there anyway to get a list of all my posts like you could do with the old forum?


                                  File a feature request in the wiki component of JIRA.