6 Replies Latest reply on Jun 11, 2004 12:38 AM by Chris Lamprecht

    How do I configure JBoss for fast JSP development?

    javajosh Newbie

      I would like to avoid generating and deploying a war file after every JSP edit. It seems that with JBoss 4DR4/embedded Tomcat 5 I can't do this. However, I would like to do this.

      We are (hopefully) transitioning from Tomcat 5 standalone to JBoss/TC5, but Tomcat has a nice feature that lets it point to an external, exploded project directory for it's webapp info. This involved editing the XML fragment in $CATALINA_HOME/conf/Catalina/localhost/mywebappcontext.xml. We like to have this fragment point to the actual CVS workspace directory such that an edit on a JSP file is picked up without having to build and deploy a war. This is a true time saver that I don't want to loose.

      Is this possible with JBoss 3 or 4? Will we be forced to use war file deployment all the time with JBoss?

        • 1. Re: How do I configure JBoss for fast JSP development?
          Joel Parramore Newbie

          You can specify an exploded deployment by placing your war contents in a sub-directory named "yourwarname.war" in the JBOSS deploy directory of whatever server (minimal, default, all, custom, etc.) that you're using.

          If the war content is in a location that can't be moved to the usual depoyment directory, you can (under *nix*) create a symlink to the true directory from the deploy directory. You can also have JBoss look elsewhere for deployables by modifying the conf/jboss-service.xml file accordingly. See http://www.jboss.org/wiki/Wiki.jsp?page=ConfiguringTheDeploymentScannerInConfjbossSystem.xml for more information on that.

          Regards,
          Joel

          • 2. Re: How do I configure JBoss for fast JSP development?
            Joel Parramore Newbie

            I should note that this is the case with Jboss 3.2.x+Tomcat. I don't know about JBoss 4.x+Tomcat.

            Regards,
            Joel

            • 3. Re: How do I configure JBoss for fast JSP development?
              javajosh Newbie

               

              "parramorej" wrote:
              You can specify an exploded deployment by placing your war contents in a sub-directory named "yourwarname.war" in the JBOSS deploy directory of whatever server (minimal, default, all, custom, etc.) that you're using.

              If the war content is in a location that can't be moved to the usual depoyment directory, you can (under *nix*) create a symlink to the true directory from the deploy directory. You can also have JBoss look elsewhere for deployables by modifying the conf/jboss-service.xml file accordingly. See http://www.jboss.org/wiki/Wiki.jsp?page=ConfiguringTheDeploymentScannerInConfjbossSystem.xml for more information on that.

              Regards,
              Joel



              Thanks, but that doesn't give me the behavior I'm looking for. I do not want to edit an exploded war because such changes are bound to be lost before commitment to CVS. I know I can tell the scanner to look at an arbitrary directory, but my project directory must have a 'war' extension. Which is ugly. And I must support both Windows and *nix platforms; otherwise symlinks would indeed be the right ticket!

              Thanks again for your assistance.

              • 4. Re: How do I configure JBoss for fast JSP development?
                Pascal Paradis-Théberge Newbie

                What I do is that I have a development tree and I have an ant task that copies the jsps in an exploded directory. The jsps that have been modified will get recompiled on access.

                Also, in theory, if something other than jsps has changed, you can touch the application descriptor or the web descriptor and trigger a redeploy. Though there seems to be a problem with the redeploy of an exploded directory as I can't get my application to work after a redeploy, I have to restart jboss or I'm getting all kinds of errors accessing my ressources.

                But in the case of the jsps, everythings works fine, I have two sets of ant tasks, one for production that packages everything and one for development that copies everything to an exploded structure.


                • 5. Re: How do I configure JBoss for fast JSP development?
                  javajosh Newbie

                   

                  "pascalpt" wrote:
                  What I do is that I have a development tree and I have an ant task that copies the jsps in an exploded directory. The jsps that have been modified will get recompiled on access.


                  Thanks. But this is only slightly better than generating a war file and copying it to the right place. I haven't actualy compared timings, but I'm sure that it is not a significant improvement. At the very least it takes Ant's JVM several seconds to fire up!

                  Recently I went a step further and defined an Ant builder in Eclipse for my project to do just what you are saying. It was significantly slower than a normal javac build, albeit tremendously flexible!

                  Why can't I have my cake and eat it too? :)

                  • 6. Re: How do I configure JBoss for fast JSP development?
                    Chris Lamprecht Newbie

                    There is a way to do what you want, I've seen Scott Stark tell people how to do it, but I don't remember the details (sorry). Search these message forums for messages from him and I think you'll find it.

                    One way, (if you're on unix) is to create a symbolic link, but as I said, I think there's a better way where you tell JBoss to look at your development directory in addition to it's normal deploy directory.