Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4AE7D175EE for ; Mon, 1 Jun 2015 19:57:18 +0000 (UTC) Received: (qmail 21648 invoked by uid 500); 1 Jun 2015 19:57:17 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 21551 invoked by uid 500); 1 Jun 2015 19:57:17 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 21539 invoked by uid 99); 1 Jun 2015 19:57:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2015 19:57:17 +0000 Date: Mon, 1 Jun 2015 19:57:17 +0000 (UTC) From: "Phil Steitz (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (POOL-292) ClassNotFoundException: org.apache.commons.pool2.impl.DefaultEvictionPolicy MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/POOL-292?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Phil Steitz updated POOL-292: ----------------------------- Fix Version/s: (was: 2.4) 2.4.1 > ClassNotFoundException: org.apache.commons.pool2.impl.DefaultEvictionPolicy > --------------------------------------------------------------------------- > > Key: POOL-292 > URL: https://issues.apache.org/jira/browse/POOL-292 > 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 exception. > 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 (v6.3.4#6332)