Tomcat & Tapestry
One thing that has been frustrating over the past few months - both for Project Duckstein and at work - is that I still don't know an "elegant" way to reliably redeploy a WAR file in Tomcat. Simply replacing the WAR in the webapps folder doesn't usually work... neither does undeploying/redeploying through the Tomcat manager. Sometimes it works, sometimes it doesn't... more often than not the only reliable way is to stop Tomcat, delete the WAR and the exploded folder, compile the new WAR, and start Tomcat. Even the ant tasks to stop/start Tomcat don't seem to work, because... well, I forget why, but they don't.
The very kludgy way I have right now is to use ant to stop/start the Tomcat service itself:
The target for a full deployment, then, is
Not exactly the most elegant solution... we still need to figure out a better way to do this.
Now, for development, this is even worse. The above mentioned process takes up to 30 seconds on my (fairly old) computer... plus another 10 seconds or so for Tapestry to first load the pages. Trial-and-error coding thus becomes a very, very painful process.
The Spindle Eclipse plugin is supposed to alleviate this, along with goodies like syntax highlighting, auto-completion, and other stuff that makes the whole process more sane... unfortunately Spindle is not yet available for Tapestry 4. I did, however, notice a post on the Spindle blog linking to instructions for setting up the Eclipse Web Tools Platform to work with Tapestry. The largest benefit at this stage of development is, by far, the automatic deployment of any changes made to classes or resources. That's right, no server restart... just save the changes and see them take effect right away. This is how I have my Eclipse set up at work, and I was really missing this capability while working on Duckstein so far.
So I am now downloading the WTP... let's see how well it works.
The very kludgy way I have right now is to use ant to stop/start the Tomcat service itself:
<target name="tomcat-netstart">
<exec executable="net">
<arg line="start tomcat5"/>
</exec>
</target>
<target name="tomcat-netstop">
<exec executable="net">
<arg line="stop tomcat5"/>
</exec>
</target>
The target for a full deployment, then, is
<target name="full" description="Full deployment" depends="tomcat-netstop,clean,dist,tomcat-netstart"/>
Not exactly the most elegant solution... we still need to figure out a better way to do this.
Now, for development, this is even worse. The above mentioned process takes up to 30 seconds on my (fairly old) computer... plus another 10 seconds or so for Tapestry to first load the pages. Trial-and-error coding thus becomes a very, very painful process.
The Spindle Eclipse plugin is supposed to alleviate this, along with goodies like syntax highlighting, auto-completion, and other stuff that makes the whole process more sane... unfortunately Spindle is not yet available for Tapestry 4. I did, however, notice a post on the Spindle blog linking to instructions for setting up the Eclipse Web Tools Platform to work with Tapestry. The largest benefit at this stage of development is, by far, the automatic deployment of any changes made to classes or resources. That's right, no server restart... just save the changes and see them take effect right away. This is how I have my Eclipse set up at work, and I was really missing this capability while working on Duckstein so far.
So I am now downloading the WTP... let's see how well it works.

1 Comments:
If you are running Tomcat on Windows, it is probably due to file locking.
You might find context.xml options like antiJARLocking help. http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
I am running Tomcat on Linux most of the time and don't have the problem.
Also pointing a context.xml at your development directory can make reloading much quicker - while testing.
Post a Comment
Links to this post:
Create a Link
<< Home