5 Replies Latest reply on Apr 23, 2010 2:06 PM by ukyovirgden

    Netbeans seam-gen and hot auto deploy for Jboss AS 5

    ukyovirgden

      Hi,


      I'm trying to get started with Seam, but my IDE of choice is Netbeans (6.8 to be specific). I'm trying to port a Spring based app with a substantial domain model to Seam.


      Here's the path I'm following



      • use seam-gen to generate project

      • open generated project in NetBeans

      • do some coding (with pojos in src/hot)

      • switch to terminal and run seam-gen explode (using jboss as 5)

      • wait a couple of seconds and reload browser to see changes 



      On the other hand, If I create a vanilla java ee 6 project in NetBeans I get all the auto and hot deployment of articacts in glassfish v3, but that is NOT the issue. I've already decided to go with JBoss AS 5 and Seam 2.2.


      My firt question is, with Seam and Jboss AS 5 how much auto deployment can I get without using Jboss Tools? As far as I can see seam-gen generated projects differ from Jboss Tools generated projects. Do I have to execute ant explode or seam explode every time I make a change?


      Is it possible to configure Jboss AS 5 to watch the target directory of the seam-gen generated project so that whenever NB auto compiles a pojo in src/hot it'd be already available for Jboss to pick up.


      The second question, is it possible to configure jboss to auto-restart when ever an artifact (ejb or entity bean) gets changed. What configuration should I tweak in order for Seam project to trigger app server reload/restart? (again using Netbeans as IDE not Eclipse with JBoss Tools)


      Thanks in advance,
      Ukyo


        • 1. Re: Netbeans seam-gen and hot auto deploy for Jboss AS 5
          ukyovirgden

          I suppose nobody is using NB 6.8, JBoss AS 5.1 and Seam 2.2.


          I've also checked out JBoss Tools and seam-gen style projects in Eclipse. While I do understand the reasoning behing the project structure of Jboss Tools I'm pretty much inclined to seam-gen project style.


          Can anyone recommend a dev stack (IDE and AppServ) where incremental and hot deployment is easy?


          Thanks in advance,
          Ukyo

          • 2. Re: Netbeans seam-gen and hot auto deploy for Jboss AS 5
            sappo

            Hi Ukyo,


            I'm currently using JBoss AS 5.1 and Seam 2.2 with Netbeans IDE 6.8.


            In my opinion it is very easy to operate.



            1. Setup your project with seam-gen

            2. Open the project with netbeans

            3. Configure the project's Build and Run properties with ANT tasks e.g. Build: explode; Run: restart-exploded; etc...

            4. You can now use the netbeans build and run button according to your configuration for example to explode your projct

            5. Start JBoss AS in debug mode



            If you now do some coding hot deploment (explode) is enabled for:



            • Images, CSS, JavaScript, static HTML, JSP

            • Facelets view templates, page descriptors (pages.xml)

            • Java classes in src/action

            • Java classes in src/action



            If you do other coding stuff like:



            • Java classes or Groovy script in src/model or components defined in component descriptors



            You'll have to use restart-exploded.


            Kind regards,
            Kevin


            P.S.: I really recommend Dan Allen's book Seam in Action as entry point for Seam.

            • 3. Re: Netbeans seam-gen and hot auto deploy for Jboss AS 5
              ukyovirgden

              Hi Kevin,


              Thanks for the reply. I've been switching back and forth between Eclipse and Netbeans, using seam-gen'd project and decided (again and again) to stick with NB.


              What I miss so far is the deploy on save feature. Sometimes it gets heavy with apache and GF v2 but I found it to be very lightweight with CDI/Weld and GF v3.


              Can you think of an easy way to accomplish a explode on save feature? Or should we just dive in the NB managed project ant file to try to find clues :)


              Thanks again,
              Ukyo.

              • 4. Re: Netbeans seam-gen and hot auto deploy for Jboss AS 5
                sappo

                Hi Ukyo,


                in my opinion the auto-deploy on save feature is really anoying.

                When I'm done with my changes I simply hit F11 for explode or F6 for restart-exploded.

                That's almost as easy as auto-deploy and you've got full control over your deployments.


                Kind regards,

                Kevin

                • 5. Re: Netbeans seam-gen and hot auto deploy for Jboss AS 5
                  ukyovirgden

                  Hi Kevin,


                  That is definitely something that I can live without :)


                  One annoyance I found out is, in NB 6.8 when editing views, code completion for seam ui tags starting with s namespace does not work out of the box, even though you put it in root declaration.


                  The workaround is simple though, I just added jboss-seam-ui.jar to classpath in the library part of the project properties dialog. The dialog box displays the warning that the libraries are going to be used only for IDE code completion and suggestion since the project ant file is not managed by IDE which the exactly the case we have.


                  Just wanted to drop a quick note of this for other NB users.


                  Cheers,
                  Ukyo