db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Giordano <giord...@more.net>
Subject [PATCH] descriptor repository patch
Date Wed, 12 Nov 2003 18:15:01 GMT
OJB developers:

Patch (descriptor-repository.patch):

Modified the Class.forName() method call to use the class loader from 
the current context of the running thread, the web application's context 
class loader.  If OJB is installed globally in Tomcat (common/lib 
directory) but the descriptor classes are located in the web 
application's context (somecontext/WEB-INF/lib), we believe there is a 
potential for a ClassNotFoundException to occur.

The Class.forName() method as it exists will default to using the class 
loader that loaded the OJB classes (the common classloader) to locate 
the descriptor classes. This class loader will delegate up the class 
loader hierarchy to locate the class which doesn't include the 
application's context class loader.

Index: src/java/org/apache/ojb/broker/metadata/DescriptorRepository.java
RCS file: 
retrieving revision 1.39
diff -r1.39 DescriptorRepository.java
<                 clazz = Class.forName(className);
 >                 ClassLoader loader = 
 >                 clazz = Class.forName(className, true, loader);

Chris Giordano

View raw message