You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2010/07/21 03:02:26 UTC

Re: Self-Contained Web Applications

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

Chuck,

(I mist have missed these replies... I'm resurrecting this thread).

On 6/25/2010 5:44 PM, Caldarale, Charles R wrote:
>> From: Jon Brisbin [mailto:jon.brisbin@npcinternational.com]
>> Subject: Re: Self-Contained Web Applications
>>
>> Wouldn't it make sense to scope it to the Context, since 
>> you'd be using the webapp's classloader?
> 
> Correct.  Note that the desired effect should be achievable by
> including commons-dbcp in its WEB-INF/lib, and coding the application
> to use that.  Completely self-contained, and not dependent on any
> container behavior or capabilities.

Well, having to include commons-dbcp is a bit of an implementation
detail, here. I should be able to include only my own JDBC driver and
have Tomcat figure out that commons-dbcp should be available elsewhere
(say, in the lib directory).

That should work even if the WebappClassLoader is being used to
initialize the DataSource, since it will call up the ClassLoader chain
to find classes not available "locally".

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

iEYEARECAAYFAkxGRyIACgkQ9CaO5/Lv0PD4bwCgkw/zD0zmMJbjROvneYT0ZCFw
whcAoMBZ8RL2iN2SdFoUqy+3q5LtTIPf
=p0vo
-----END PGP SIGNATURE-----

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


Re: Self-Contained Web Applications

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chuck,

On 7/20/2010 11:14 PM, Caldarale, Charles R wrote:
>> From: Christopher Schultz [mailto:chris@christopherschultz.net]
>> Subject: Re: Self-Contained Web Applications
>>
>> Well, having to include commons-dbcp is a bit of an implementation
>> detail, here. I should be able to include only my own JDBC driver and
>> have Tomcat figure out that commons-dbcp should be available elsewhere
>> (say, in the lib directory).
> 
> But now you're asking commons-dbcp classes (loaded by the common
> classloader) to look _downwards_ in the classloader hierarchy to find
> the JDBC driver they're using for the connections.  I don't think
> that's going to happen - ever.

Obviously, the classes themselves have no knowledge of the class loading
hierarchy. As long as the WebappClassLoader is the context ClassLoader
for the thread that creates the DataSource, all should be well.

Am I missing something tremendous, here?

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

iEYEARECAAYFAkxHCkQACgkQ9CaO5/Lv0PALxQCeLCCNOSBJWPaeqoq1aF3RI27N
3GAAnjm3UvsCVUyYee4w6x3CBxMznrWb
=e5Sm
-----END PGP SIGNATURE-----

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


RE: Self-Contained Web Applications

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Christopher Schultz [mailto:chris@christopherschultz.net]
> Subject: Re: Self-Contained Web Applications
> 
> Well, having to include commons-dbcp is a bit of an implementation
> detail, here. I should be able to include only my own JDBC driver and
> have Tomcat figure out that commons-dbcp should be available elsewhere
> (say, in the lib directory).

But now you're asking commons-dbcp classes (loaded by the common classloader) to look _downwards_ in the classloader hierarchy to find the JDBC driver they're using for the connections.  I don't think that's going to happen - ever.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.