Incidentally, I, too, have found the "path" and "docBase" attributes to be
tricky in Tomcat.  I fiddle with them until I get the desired result (ugh),
but the language describing them has never helped me much in figuring out
why what works actually works.

On 5/29/06, Mark Petrovic <[EMAIL PROTECTED]> wrote:

Hi.

Context fragments can also be put in your webapp's META-INF directory, per
the 4th bullet item here

http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

E.g.,

pluto:PGCRM> jar tf dist/crmrpc.war |head -3
META-INF/
META-INF/MANIFEST.MF
META-INF/context.xml

where context.xml contains, in my particular case, a JDBC resource
definition

<Context path="/crmrpc" debug="5" reloadable="true" crossContext="true">
   <Resource
      name="jdbc/crm"
      auth="Container"
      type=" javax.sql.DataSource"
      maxActive="100"
      maxIdle="30"
      maxWait="10000"
      username="u"
      password="p"
      driverClassName=" com.mysql.jdbc.Driver"
      url="jdbc:mysql://localhost:3306/cm?autoReconnect=true"
      />
</Context>



On 5/29/06, Chris Walker <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I have just migrated a family of webapps from Tomcat 4 to Tomcat 5.5
> .  It's
> working OK, but reading through the documentation I see there is a
> recommendation that I remove the <Context> sections from server.xml and
> put
> them in files in {catalina_root}/conf/[engine]/[Host].
>
> But when I do this I find that each of the contexts just responds with
> an
> empty HTML page - no HTTP error, and nothing in any of the Tomcat logs
> to
> suggest an error.  This is the response:
>
>
> ----------------------------------------------------------------------------
> ---
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=Content-Type content="text/html;
> charset=windows-1252"></HEAD>
> <BODY></BODY></HTML>
> ----------------------------------------------------------------------------
>
> ---
>
> I've tried various names for the context XML files, and I've tried
> specifying an absolute path for the context docBase, but it seems to
> make no
> difference.
>
> Can anybody suggest what I'm doing wrong?
>
> Chris Walker
>
>
> ----------------------------------------------------------------------------
> ---
> This is my server.xml after modification:
>
> <Server port="8005" shutdown="SHUTDOWN">
>
>   <Service name="Catalina">
>
>     <Connector port="80"
>                maxHttpHeaderSize="8192"
>                maxThreads="150" minSpareThreads="25"
> maxSpareThreads="75"
>                enableLookups="false" redirectPort="8443"
> acceptCount="100"
>                connectionTimeout="20000" disableUploadTimeout="true" />
>
>     <Connector port="8009"
>                enableLookups="false" redirectPort="8443"
> protocol="AJP/1.3"
> />
>
>     <Engine name="Catalina" defaultHost="www.iboserver.com ">
>
>         <Host name="www.iboserver.com" debug="0"
>                 appBase="webapps/ibo"
>                 unpackWARs="false"
>                 autoDeploy="false"
>                 liveDeploy="false"
>                 deployOnStartup="false"
>                 deployXML="false">
>
> <!--
>   This section moved to ./Catalina/www.iboserver.com/ROOT.xml
>
>   vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> vvvvv
>
>          <Context path="" docBase="ibo3"
>                 debug="1"
>                 reloadable="false"
>                 crossContext="true">
>
>             <Logger className="org.apache.catalina.logger.FileLogger"
>                  prefix="ibo3_log." suffix=".txt"
>                  timestamp="true"/>
>
>             <Valve className="org.apache.catalina.valves.AccessLogValve"
>                  directory="logs"  prefix="ibo3_access" suffix=".log"
>                  pattern="common" resolveHosts="false"/>
>
>          </Context>
>
>
>   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ^^^^^^
> -->
>
> <!--
>   This section moved to ./Catalina/www.iboserver.com/ibo4.xml
>
>   vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> vvvvvv
>
>         <Context path="/ibo4" docBase="ibo4.200306.1"
>                 debug="1"
>                 reloadable="false"
>                 crossContext="true">
>
>             <Logger className="org.apache.catalina.logger.FileLogger"
>                 prefix="ibo4_log." suffix=".txt"
>                 timestamp="true"/>
>
>             <Valve className="org.apache.catalina.valves.AccessLogValve"
>                  directory="logs"  prefix="ibo4_access" suffix=".log"
>                  pattern="common" resolveHosts="false"/>
>
>             <Environment name="url.root"
>                 value="https://www.invoicebackoffice.com/ibo4";
>                 type=" java.lang.String" override="false"/>
>
>             <Environment name="smtp.server"
>                 value="localhost"
>                 type="java.lang.String" override="false"/>
>
>             <Environment name="dataStreamDefinitions"
>                 value="/etc/ibo/DataStreams.xml"
>                 type="java.lang.String" override="false"/>
>
>             <Environment name="connectionPool/JDBCDriver"
>                 value="com.mysql.jdbc.Driver"
>                 type="java.lang.String" override="false"/>
>
>             <Environment name="connectionPool/JDBCConnectionURL"
>                 value="jdbc:mysql://localhost/ibo"
>                 type="java.lang.String" override="false"/>
>
>             <Environment name="connectionPool/User"
>                 value="root"
>                 type="java.lang.String" override="false"/>
>
>             <Environment name="connectionPool/Password"
>                 value=""
>                 type="java.lang.String" override="false"/>
>
>             <Environment name="connectionPool/ConnectionPoolSize"
>                 value="5"
>                 type="java.lang.String" override="false"/>
>
>             <Environment name="connectionPool/ConnectionPoolMax"
>                 value="100"
>                 type=" java.lang.String" override="false"/>
>
>             <Environment name="connectionPool/ConnectionUseCount"
>                 value="50"
>                 type="java.lang.String " override="false"/>
>
>             <Environment name="connectionPool/ConnectionTimeout"
>                 value="1200"
>                 type="java.lang.String" override="false"/>
>
>             <Environment name="connectionPool/PoolDumpFrequency"
>                 value="1000"
>                 type="java.lang.String" override="false"/>
>
>         </Context>
>
>   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ^^^^^
> -->
>       </Host>
>
>         <Host name="www.cboserver.com" debug="0"
>                 appBase="webapps/cbo"
>                 unpackWARs="false" autoDeploy="false"
> deployOnStartup="false">
>
> <!--
>   This section moved to ./Catalina/www.cboserver.com/ROOT.xml
>
>   vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> vvvvvvv
>
>         <Context path="" docBase="cboweb.040506" debug="1"/>
>
>   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> ^^^^^^^
> -->
>
>         <Logger className="org.apache.catalina.logger.FileLogger"
>                  prefix="cbo_log." suffix=".txt"
>                  timestamp="true"/>
>          <Valve className="org.apache.catalina.valves.AccessLogValve"
>                  directory="logs"  prefix="cbo_access" suffix=".log"
>                  pattern="common" resolveHosts="false"/>
>         </Host>
>
>     </Engine>
>
>   </Service>
>
> </Server>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Mark
AE6RT




--
Mark
AE6RT

Reply via email to