You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thomas Neidhart (JIRA)" <ji...@apache.org> on 2015/05/12 20:33:09 UTC

[jira] [Commented] (POOL-289) Wrong ClassLoader used in BaseGenericObjectPool

    [ https://issues.apache.org/jira/browse/POOL-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14540417#comment-14540417 ] 

Thomas Neidhart commented on POOL-289:
--------------------------------------

I think the patch is fine, but I would revert the order of the classloaders:

 * first try the classloader that loaded the BaseGenericObjectPool (the Class.forName(className) call as before)
 * if that fails, try the TCCL
 * if that fails, throw further


> Wrong ClassLoader used in BaseGenericObjectPool
> -----------------------------------------------
>
>                 Key: POOL-289
>                 URL: https://issues.apache.org/jira/browse/POOL-289
>             Project: Commons Pool
>          Issue Type: Bug
>    Affects Versions: 2.3
>         Environment: All
>            Reporter: Luke Winkenbach
>            Priority: Critical
>             Fix For: 2.4
>
>         Attachments: classpath_fix.patch
>
>
> BaseGenericObjectPool uses Class.forName to load an EvictionPolicy with the thread context ClassLoader.  This does not work in OSGi environments.  If the class load fails with the thread context ClassLoader, the code should attempt to load using the BaseGenericObjectPool class's ClassLoader as well.  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)