tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <>
Subject Re: Self-Contained Web Applications
Date Fri, 25 Jun 2010 16:44:39 GMT
On 25/06/2010 17:02, Christopher Schultz wrote:
> All,
> While reading another thread ("What's going on ... ?"), I started to
> think about how inconvenient it is to have to put your JDBC driver into
> the server's lib directory. As it stands, now, all webapps must share
> the same version of the same driver, and the main installation of Tomcat
> (or scion, when using CATALINA_BASE) must be modified from the default
> in order to deploy your application :(

You can define a lib dir under CATALINA_BASE and Tomcat will load jars
from there by preference over CATALINA_HOME, no?

If it doesn't do it by default you can modify so it

> It would seem to me that, if the webapps's META-INF/context.xml file
> defines a JNDI <Resource>, that the server could use the context's
> libraries to initialize those resources.

You can define a DataSource in context.xml - that's why Realm has
localDataSource.  Or do you mean something else?


> If the above were possible, then a web application could really be
> self-contained. That would allow different webapps deployed onto the
> same server to use different JDBC drivers for the same (type of)
> database, which would be really nice.
> Can any of the Tomcat wonks comment on the possibility of using the
> WebappClassLoader to initialize JNDI resources? I suppose this would
> also touch on the subject of JNDI DataSources never being closed, since
> using the WebappClassLoader without closing those resources would create
> a costly resource leak.
> Thanks,
> -chris

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message