Tomcat server.xml file

A

Aaron

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top