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: 
/home/cvspublic/jakarta-ojb/src/java/org/apache/ojb/broker/metadata/DescriptorRepository.java,v
retrieving revision 1.39
diff -r1.39 DescriptorRepository.java
484c484,485
<                 clazz = Class.forName(className);
---
 >                 ClassLoader loader = 
Thread.currentThread().getContextClassLoader();
 >                 clazz = Class.forName(className, true, loader);



Chris Giordano
giordano@more.net






Mime
View raw message