tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: tomcat error 404
Date Tue, 25 Oct 2011 13:33:44 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dave,

On 10/23/2011 12:20 PM, Dave Filchak wrote:
> Ok, perhaps this will be more helpful. To follow is the way the db 
> connection is set up now, and I am not sure it is correct because,
> as I understand it, you are supposed to add a context to the
> server.xml

It's better to use a META-INF/context.xml file instead of adding a
<Context> to server.xml.

> file defining the db connection through jdbc/mysql ( which I am not
> sure of the format yet ), either in the main system one or the
> application specific one, OR to the META-INF/content.xml file,
> which I do not have. What I do have is this, in my application
> directory at 
> /home/XXXXXX/public_html/WEB-INF/conf/environment.xml:

If you have environment.xml, then your JDBC connection pool is
probably being configured by some other component and you don't
necessarily need Tomcat's connection pool.

> <jdbc-config> <driver>com.mysql.jdbc.Driver</driver> 
> <url>jdbc:mysql://###.###.###.###:3306/#######_exodus</url> 
> <user>#########_exodus</user> <password>#####</password> 
> <max>10</max> <init>10</init> <queueQuery>select
> now()</queueQuery>

For "queueQuery" (presumably a connection test), use "/* ping */
SELECT 1" -- it will usually be faster than a real query, and
falls-back to "SELECT 1" (pretty simple) if your driver doesn't
understand the "ping" hint.

> <logFile>/home/#####/public_html/WEB-INF/logs/pool.txt</logFile>

Beware of putting log files into the webapp's deployment directory:
they will be deleted when the webapp is undeployed.

> Apparently, you are also supposed to add an entry in
> the</*CONTEXT_HOME*/>/WEB-INF/web.xml and I am not sure if this is
> true but in my/home/#####/public_html/WEB-INF/web.xml there is no
> reference to the database.

You don't need one: if you define the data source within your own
webapp, then you don't need anything in web.xml (you were probably
reading about <resource-ref>).

> However, this used to work on the old server. So, in a nutshell,
> the only reference to a database connection is in the
> environment.xml file.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6murgACgkQ9CaO5/Lv0PBLfQCbBGJYap+/Gg7ZnUp9DNRp/xpt
7hkAnRZmVM9d41eURr1NJ0X0Cx5M9/6C
=YhrE
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message