Sylvain Wallez wrote:
> 
> Shouldn't there be a mean in Avalon to store this "application root
> ClassLoader" and use it in selected places, like JDBC driver loading ?
> This will allow the JdbcDataSource <driver> to be loaded in the same
> ClassLoader as with the "force-load" parameter.

Cocoon stores the Application Root Classloader in each threads Context
Classloader so that we can execute the following snippet to get it:

Thread.currentThread().getContextClassLoader();

The issue with the JDBC driver was the the loadClass(name) function does
not resolve the class--which is essential to dynamically installing the
driver in the JDBC DriverManager.

I solved the problem by using the JDK1.2 (or is it 1.3 specific) method:

Class.forName(name, true, classLoader);

What this does is load a class with the specified classloader, and the
"true" parameter tells the ClassLoader to resolve the class.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to