Tomcat server.xml file

Discussion in 'Java' started by Aaron, Jun 7, 2004.

  1. Aaron

    Aaron Guest

    Hello,

    I am trying to use the open source NFC chat program with Tomcat 4.1.
    When starting tomcat i get the error message:

    ContextConfig[]: Missing application web.xml, using defaults only

    I assume the problem lies in my server.xml file where i have.....

    <Host name="address.address.com" debug="9" appsBase="webapps/nfc">
    <Logger className="org.apache.catalina.logger.FileLogger" debug="0"
    directory="logs" prefix="address.address.com_log." suffix=".txt"
    timestamp="true" verbosity="1"/>
    <Context path="/manager" docBase="C:\Program Files\Apache
    Group\Tomcat 4.1\server\webapps\manager" debug="0" privileged="true">

    <!-- Link to the user database we will get roles from -->
    <ResourceLink name="users" global="UserDatabase"
    type="org.apache.catalina.UserDatabase"/>
    </Context>

    <Context path="" docBase="D:\office\program\web" debug="9"
    reloadable="true" crossContext="false">
    <Resource auth="Container" description="pooled sql2000 Connection"
    name="VARIABLE" scope="Shareable" type="javax.sql.DataSource"/>
    <ResourceParams name="VARIABLE">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>

    <parameter>
    <name>driverClassName</name>
    <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
    </parameter>

    --------------and more parameters------------

    </ResourceParams>
    </Context>
    </Host>


    In the <Host> appsbase i have it pointing to the folder which contains
    the WEB-INF folder and in the <Context> path i have it also pointing
    to the folder which contains the WEB-INF folder. Both WEB-INF folders
    contain the web.xml file.

    I don't know if my directory structure is a little off or if I am
    pointing Tomcat to the wrong folders. In any case I am getting the
    "ContextConfig[]: Missing application web.xml, using defaults only"
    error and i'm not sure how to correct it.

    As it stands, the program runs, but I am trying to connect it to a SQL
    database and I am getting an error when i execute the following lines
    of code:

    try {
    ctx = new InitialContext();
    ds = (DataSource)ctx.lookup("java:comp/env/VARIABLE");
    } catch(javax.naming.NamingException e) {
    error = "NamingException in
    DataServices.PooledConnectionBean.init: " + e.getMessage();
    close();
    return -1;
    }

    Therefore, I think the context lookup is failing b/c my server.xml
    file isn't pointing tomcat in the right direction.

    In the web.xml file I have:

    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>VARIABLE</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>




    Any help would be greatly appreciated. I am editing someone else's
    code, which at times, can be rather confusing.

    Thanks again,

    Aaron
    Aaron, Jun 7, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Nettles
    Replies:
    0
    Views:
    401
    David Nettles
    May 8, 2004
  2. adamR
    Replies:
    4
    Views:
    2,620
    Juha Laiho
    Jul 16, 2004
  3. sjoshi
    Replies:
    0
    Views:
    6,602
    sjoshi
    Sep 27, 2005
  4. Replies:
    5
    Views:
    514
  5. Erik Wasser
    Replies:
    5
    Views:
    430
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page