commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <>
Subject [jira] [Updated] (POOL-292) ClassNotFoundException: org.apache.commons.pool2.impl.DefaultEvictionPolicy
Date Mon, 01 Jun 2015 19:57:17 GMT


Phil Steitz updated POOL-292:
    Fix Version/s:     (was: 2.4)

> ClassNotFoundException: org.apache.commons.pool2.impl.DefaultEvictionPolicy
> ---------------------------------------------------------------------------
>                 Key: POOL-292
>                 URL:
>             Project: Commons Pool
>          Issue Type: Bug
>    Affects Versions: 2.3
>         Environment: Apache Karaf OSGi
>            Reporter: Narayanan Harihara
>              Labels: OSGi,, classnotfoundexception
>             Fix For: 2.4.1
> Here is my application structure:
> myapplication-bundle(uses mybatis) -->  datasource-bundle (uses commons-dbcp2) -->
commons-pool2 bundle.
> With this structure, all the datasource API information are hidden from my application
and only javax.sql.DataSource is exported from the datasource-bundle. So I do not have OSGi
import package for org.apache.commons.pool2.impl in my application. 
> But on version 2.3 of commons-pool2, the method org.apache.commons.pool2.impl.BaseGenericObjectPool.setEvictionPolicyClassName
is using Thread.currentThread().getContextClassLoader() to load EvicationPolicy class, which
means it is using the class loader of myapplication to load org.apache.commons.pool2.impl.DefaultEvictionPolicy
class. Since I do not have that in myapplication-bundle's OSGi Import-Package, I get a ClassNotFound
> This issue did not happen in commons-pool2 version 2.2 because, it did not use the current
thread's class loader to instantiate the eviction policy. Due to this, I am kinda forced to
use 2.2 version in my environment and i would like to stay on the latest version due to all
the bug fixes with concurrency. 
> Any help would be really appreciated. 

This message was sent by Atlassian JIRA

View raw message