-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ziggy,

On 10/15/2009 3:31 PM, Ziggy wrote:
> I have read about this a bit and i think that all JNDI resources must be in
> $CATALINA_HOME/common/lib which explains why If i put the driver in the
> application's lib folder it cant access it because the common class loader
> wouldn't know of the libraries in the applications lib folders..

I believe this is correct: the JNDI resources for a webapp are
initialized using the server's ClassLoader, not the webapp's
ClassLoader. I'm not entirely sure why this is the case, but it is. For
this reason, you must place your JDBC drivers (and anything else
required for JNDI resources) in CATALINA_BASE/common/lib (on TC 5.5) or
CATALINA_BASE/lib (on TC 6.0), or, define some other ClassLoader that is
available /before/ the webapp's ClassLoader becomes useful.

> The tomcat installation only runs this one application. I  would like to be
> able to move the application's war file (which will include all libraries in
> the WEB-INF/lib folder) around to other tomcat instances if i need to
> without having to worry about moving libraries as well.

I think this is a reasonable desire, and I'm not sure why Tomcat's
architecture does not allow this. Honestly, using the webapp's
ClassLoader to create JNDI resources would make a lot of sense and fix
at least one long-standing bug/resource leak when restarting webapps.

> Its a bit weird that i configure the JNDI resource in the application's
> context file but the library that the context file is refering to is to be
> kept outside of the application.

Agreed.

> is there a way i can use the JNDI resource but have the jdbc driver in the
> application's WEB-INF/lib directory?

This is a bug/feature which must be changed at the Tomcat source level.
There is no configuration that can get you what you want. Sorry.

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

iEYEARECAAYFAkrXjQcACgkQ9CaO5/Lv0PC6WQCgkoCIVPBxIRTPvdIBv31B7tkv
l6AAoJZ/Aq47i49SrUzatu5/K9DSqnvO
=kbXg
-----END PGP SIGNATURE-----

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

Reply via email to