Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Download Tomcat 7 and install to a location of choice
  2. Download Sysdeo Eclipse Tomcat Launcher. Unzip, copy the com.sysdeo.. folder to your /eclipse/plugins/ folder
  3. Restart Eclipse, verify you see the Tomcat control buttons in Eclipse toolbar Image Modified
  4. svn checkout http://svn.codehaus.org/tynamo/trunk/tynamo-examples/simple/ tynamo-simple
  5. Import... / Existing Maven Projects, navigate to tynamo-simple folder
  6. Configure Tomcat Launcher:
    1. In Window / Preferences / Tomcat, set Tomcat version to 6.x (even for 7.x) and set the home folder. Set Context declaration mode to context files
    2. In Tomcat / JVM Settings, add Jar/Zip item and point to tomcat-juli.jar found in your TOMCAT_HOME/bin folder (this is only needed for 7.x)
    3. In Tomcat / JVM parameters, add parameters as appropriate. I typically use at least: -Dtapestry.production-mode=false and -XX:MaxPermSize=256m
    4. In Tomcat / Tomcat Manager App, set manager app url and manager admin username and password correctly. Set manager app url to .../manager/text (for Tomcat 7.x - the default /manager/ is correct for previous versions). Image Modified
  7. Install devloader for Tomcat (for Tomcat 7.x use devloader from version 3.3). The devloader.zip is found inside Sysdeo's Tomcat Launcher zip package. Unzip and copy the org folder and its contents to TOMCAT_HOME/lib
  8. In project properties (choose project, ALT+ENTER) configure Java build path
    1. For src/main/resources folder, set the output to the same as the source folder (i.e. src/main/resources, Eclipse doesn't have a separate checkbox for "don't copy")
    2. For default output folder, keep the output folder as /target/classes if you are using m2eclipse (this is because of limitations in m2eclipse's implementation). Otherwise, you may want to set the output to something else, such as /target/eclipse-classes so it differs from Maven default (/target/classes) so you can use both Eclipse and Maven from command line without them stepping on each other
    3. In project properties / Tomcat
    4. Check "Is a Tomcat Project"
    5. Context name as you like, I often use just /ROOT for simplicity
    6. "Subdirectory to set as web application root", set "src/main/webapp"
    7. On "DevLoader ClassPath" tab, check activate DevLoader. Configure as appropriate, but typically "Check All" libraries, find servlet-api and uncheck it (obviously the container contains those classes and wants to load from there rather than as part of the web application). Also uncheck all of jre libs and "MAVEN2_CLASSPATH_CONTAINER" at the bottom, and for the simple webapp, you also need to uncheck the jetty-libs, particularly the servlet api included by Jetty. Image Modified
  9. Enjoy live class reloading and your optimized development cycle (smile)

...

As mentioned earlier, a duplicate servlet-api in your webapplication classpath will mess up your container for sure. For Tapestry, if you see an exception trace similar to:

Code Block

Nov 15, 2010 10:38:47 AM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter app
java.lang.ClassCastException: org.apache.tapestry5.TapestryFilter cannot be cast to javax.servlet.Filter
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:248)

...