You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Armin Waibel <ar...@code-au-lait.de> on 2003/11/12 19:35:18 UTC
Re: [PATCH] descriptor repository patch
Hi Chris,
thanks for the detailed report!
fix is in CVS
regards,
Armin
Chris Giordano wrote:
> 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
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> Index: src/java/org/apache/ojb/broker/metadata/DescriptorRepository.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-ojb/src/java/org/apache/ojb/broker/metadata/De
> scriptorRepository.java,v
> retrieving revision 1.39
> diff -r1.39 DescriptorRepository.java
> 484c484,485
> < clazz = Class.forName(className);
> ---
>
>> ClassLoader loader = Thread.currentThread().getContextClassLoa
>
> der();
>
>> clazz = Class.forName(className, true, loader);
>
>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org