Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Tomcat server.xml file

Reply
Thread Tools

Tomcat server.xml file

 
 
Aaron
Guest
Posts: n/a
 
      06-07-2004
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.BasicDataSourceFact ory</value>
</parameter>

<parameter>
<name>driverClassName</name>
<value>com.microsoft.jdbc.sqlserver.SQLServerDrive r</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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which JVM to use for Tomcat 5.0.28 and Tomcat 5.5.4? Katerina McLean Java 1 12-10-2004 10:55 PM
Tomcat 4.1.31 - huge count of webapps, Tomcat hangs up Martin Eberle Java 2 12-03-2004 07:10 PM
Tomcat Web application manager - Virtual host Tomcat 4.30 + Apache2 + JK2 connector with multi IPs Joe Java 0 07-12-2004 03:06 PM
Apache Tomcat 4.1.24: problem with Tomcat Administration link Christos Gravvanis Java 0 07-07-2004 05:21 PM
[TOMCAT] Tomcat crashes %=zerointeractive.it% Java 1 01-22-2004 12:08 PM



Advertisments