1 Reply Latest reply on Jul 13, 2004 6:17 PM by sramkishan

    configuring Tomcat 5.0 to serve static content

    mhixson Newbie

      I have a directory from which I'd like to serve static images. This directory is /usr/local/watermarks and lies outside of the jboss directory structure (which is in /usr/local/jboss). This is JBoss 3.2.4 and Tomcat 5.0.26.
      Inside of

      <Engine name="jboss.web" defaultHost="localhost">
      I've added this

      <Host name="localhost" debug="99"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
      
      <!-- ADD WATERMARKS DIRECTORY -->
       <Context path="/watermarks" appBase="webapps"
       docBase="/usr/local/watermarks"
       debug="99" reloadable="true">
       </Context>
       </Host>
      

      Going to http://mymachinename.com/watermarks/ I get a 404 and the message: The requested resource (/watermarks/) is not available.

      I've found no error messages in the logs regarding the watermarks context. Is there some way to get JBoss or Tomcat to tell me *why* the context is unavailable?
      I had this working with JBoss 3.2.3 so I know its not just a filesystem permissions issue. JBoss or Tomcat are preventing me from seeing the watermarks context for some reason.
      Any help would be greatly appreciated.

        • 1. Re: configuring Tomcat 5.0 to serve static content
          sramkishan Newbie

          This is a problem only in Jboss/Tomcat5.026
          What tomcat5.0.26 expects is the defaultWebXml attribute when specifying the Context. So your code should actually be

          <Context path="/watermarks" appBase="webapps"
           docBase="/usr/local/watermarks"
           debug="99" reloadable="true" defaultWebXml="path to the default web xml">

          Copy the web.xml from tomcat....sar folder to probably the conf directory of jboss and give that path. It should work.