tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Multiple problems with Tomcat and Struts
Date Wed, 12 Dec 2007 22:08:56 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Uma,

Uma Kalluru wrote:
> I am using Struts1.x with Tomcat 5.5 and I see lots of problems in the
> log file. Actually I am using Struts data source manager to create
> connection pool at the startup of the server.

It's a bit off topic, but you should stop doing that. Struts stopped
supporting DataSource configuration /years/ ago in favor of
container-manager data sources.

> The application works fine for some time but after some time the
> connection object is null. I am not sure how this would happen. Can
> any one help me out please? This is urgent.

Your pooled database connections are probably timing out. After the
first error, do you get continuous errors afterward, or do the
connections reconnect or anything like that?

Your best bet is to configure your data source through Tomcat. See
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
(specifically, the "Context Configuration" section) for a simple example
of how to enable container-managed data sources. Just put the <Resource>
element into your META-INF/context.xml file (you /are/ using a
META-INF/context.xml file, right?!). Remember to set a "validation
query" so that connections will be tested for connectivity before they
are handed over to your application.

- -chris

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

iD8DBQFHYFv49CaO5/Lv0PARAjOpAKCeXoGIO6GN6ASHcRZ1SMU2zXr4fwCeLDCs
q/80HzjltPsB0Er2AgTqw5s=
=no2p
-----END PGP SIGNATURE-----

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


Mime
View raw message