6 Replies Latest reply on Apr 23, 2002 6:02 PM by Mark Hortman

    HOWTO: root.ear - tomcat 4.0.1 root application to deploy in

    Dominique Plante Newbie

      Here's the steps I took to create root.ear (using Windows ME). As soon as I can get file attachments working, I'll post it here :)

      If someone would be so kind as to show me the steps to create this file using ant, that would be fantastic. I'm not up to speed up enough with ant to do this :(

      This file has the contents of the $TOMCAT401HOME/webapps/ROOT web application.

      If you copy this file to $JBOSSHOME/deploy, and make sure no other app is using the / context, (like jboss-root.ear),
      then when you access http://localhost:8080 (assuming you haven't changed catalina's port from the default, and you've started jboss with catalina support), you'll see the catalina welcome page you'd be used to if you'd started catalina standalone and accessed http://localhost:8080.

      Also, it wouldn't hurt to deploy the webapps that come with tomcat 4.0.1:
      1. cd $CATALINAHOME\webapps\examples
      2. jar -cvf examples.war *
      3. mv examples.war $JBOSSHOME\deploy

      (follow the same steps as above for tomcat-docs webapps)

      I tried to pattern what's in jboss-root.ear. I wouldn't try putting both of these files in $JBOSSHOME\jboss\deploy !

      Here's what I did ($JBOSSHOME = c:\jb244_tc401):

      1. cd c:\jb244_tc401\catalina\webapps\ROOT

      2. jar -cvf root.war *

      3. mkdir c:\TEMPROOTWORK

      4. move root.war c:\TEMPROOTWORK

      5. cd c:\TEMPROOTWORK

      6. mkdir meta-inf

      7. create root.xml with the following contents:
      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN' 'http://java.sun.com/j2ee/dtds/web-app_2_2.dtd'>

      <web-app>
      <session-config>
      <session-timeout>
      30
      </session-timeout>
      </session-config>
      <welcome-file-list>
      <welcome-file>
      index.jsp
      </welcome-file>
      <welcome-file>
      index.html
      </welcome-file>
      <welcome-file>
      index.htm
      </welcome-file>
      </welcome-file-list>
      </web-app>

      8. Create application.xml in meta-inf with the following contents:
      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN' 'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>


      <display-name>root</display-name>
      Tomcat Root Application


      <web-uri>root.war</web-uri>
      <context-root>/</context-root>

      <alt-dd>root.xml</alt-dd>



      (optional) 9. Create a manifest.mf file in meta-inf with a couple carriage returns

      10. execute 'jar -cvf root.ear *' from c:\TEMPROOTWORK

      11. copy root.ear to c:\jb244_tc401\jboss\deploy

      and you're ready to start jboss. If you go to http://localhost:8080, you'd swear you'd started tomcat standalone :)