Deploying Apps to Tomcat

 


Contents

  1. Overview
  2. Common Problems

See Also

  1. deploytool
  2. admintool

 


Overview

  1. Grant permissions by editing $HOME/build.properties...

    username=username 
    
    password=password

    ...where username and password match a username and password set in...

     $TOMCAT_HOME/conf/tomcat-users.xml
    

    For example:

    <?xml version='1.0'?>
    <tomcat-users>
    <role rolename="admin"/>
    <role rolename="manager"/>
    <role rolename="provider"/>
    <user username="username" 
          password="password"
          roles="admin,manager,provider"/>
    </tomcat-users>
    
    

  2. Set $HOME/build.properties unreadable to anyone but username:

    chown username $HOME/build.properties
    chmod 600 $HOME/build.properties

  3. Set CLASSPATH to include catalina-ant.jar and j2ee.jar.

  4. Build the app

    ant build

  5. Deploy the app:

    ant install

  6. To run, pull up a browser and go to

    http://domain/contextpath

    Where contextpath is defined in build.xml

 


Common Problems

If you get:

java.io.IOException: Server returned HTTP response code: 401

Verify your username password have been assigned the manager role tomcat-users.xml file.

If you get...


[install] FAIL - Application already exists at path /path

...the app has already been installed. To redeploy:

ant reload

  • If your app does not load:

    • Check pathing and permissions. Are all jar files in CLASSPATH. Are files and directories readable by your Tomcat user?

      ping domain

    • Confirm resource is accessible:

      ping domain

    • Check application log

      $TOMCAT_HOME/logs/jwsdp_log.date.txt.

    • Check system log

      $TOMCAT_HOME/logs/catalina.out

  • If you get:

    HTTP 500: No Context Error

    Tomcat does not know about your application. Try running through the deploy cycle again:

    • ant remove
    • ant build
    • ant install
    • ant reload

     

     

    Home