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 CF120179F7 for ; Tue, 12 May 2015 14:40:06 +0000 (UTC) Received: (qmail 12423 invoked by uid 500); 12 May 2015 14:40:06 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 12336 invoked by uid 500); 12 May 2015 14:40:06 -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 12324 invoked by uid 99); 12 May 2015 14:40:06 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 May 2015 14:40:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id DC5A018294F for ; Tue, 12 May 2015 14:40:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.979 X-Spam-Level: ** X-Spam-Status: No, score=2.979 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, KAM_UNSUB1=0.1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 3W37knBPaRUL for ; Tue, 12 May 2015 14:40:04 +0000 (UTC) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 04F4E21784 for ; Tue, 12 May 2015 14:40:04 +0000 (UTC) Received: by widdi4 with SMTP id di4so18597958wid.0 for ; Tue, 12 May 2015 07:38:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=9AplpFuUri0N5JtzzA6YYGztj7bPL9/ocasIceyKtd4=; b=eb6L6zHGCjekEvPvHVmsVMjAO+SyhpAcSinQYk/f2iLfjRNLY4efHHNxcWyBIiHTaV 69Hen4HH5tK81KF13hOPKrvIYx0/ZzYisDMxl0ZXJ/fVVEa0Xc3VgVe6uCKoQCp1prOo Mi+HIviBE2Dj/8VSSJe2xfk284MQqDyXjaWHRMyLQPjEDzjCyUgaFYGUvIgtao/dVpnh e+Z8beopVun2lRevBVlO9/xxS58nF2dnHFMorS+g6Q/mQ1ZGmBgTXiMLw1YOTz2E81S+ 5cYMtOgMAYhSC9e5WMEi/JTqyjvRmA+6raPv7lZkFe1fTh8flNTy9DlOBbPoByz+NLGc lnRg== MIME-Version: 1.0 X-Received: by 10.194.86.101 with SMTP id o5mr31453470wjz.8.1431441513458; Tue, 12 May 2015 07:38:33 -0700 (PDT) Received: by 10.28.88.149 with HTTP; Tue, 12 May 2015 07:38:33 -0700 (PDT) In-Reply-To: References: Date: Tue, 12 May 2015 22:38:33 +0800 Message-ID: Subject: Re: [jira] [Updated] (POOL-292) ClassNotFoundException: org.apache.commons.pool2.impl.DefaultEvictionPolicy From: Kevin Kuo To: issues@commons.apache.org Content-Type: multipart/alternative; boundary=089e0102f352ed31070515e372a7 --089e0102f352ed31070515e372a7 Content-Type: text/plain; charset=UTF-8 unsubscribe On Tue, May 12, 2015 at 9:58 PM, Phil Steitz (JIRA) wrote: > > [ > 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: 2.4 > > > 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 > > > > > > 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) > -- Kevin Kuo --089e0102f352ed31070515e372a7--