From issues-return-73528-archive-asf-public=cust-asf.ponee.io@commons.apache.org Tue Apr 16 17:24:02 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 7211B180630 for ; Tue, 16 Apr 2019 19:24:02 +0200 (CEST) Received: (qmail 26195 invoked by uid 500); 16 Apr 2019 17:24:01 -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 26174 invoked by uid 99); 16 Apr 2019 17:24:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Apr 2019 17:24:01 +0000 Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id C73E2E27D4 for ; Tue, 16 Apr 2019 17:24:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 769E524595 for ; Tue, 16 Apr 2019 17:24:00 +0000 (UTC) Date: Tue, 16 Apr 2019 17:24:00 +0000 (UTC) From: "Gary Gregory (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DBCP-544) Custom Shared ClassLoader not working after migrated from Tomcat 7 to Tomcat 9.0.17 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DBCP-544?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D168193= 00#comment-16819300 ]=20 Gary Gregory commented on DBCP-544: ----------------------------------- Why is this a DBCP issue? > Custom Shared ClassLoader not working after migrated from Tomcat 7 to Tom= cat 9.0.17 > -------------------------------------------------------------------------= ---------- > > Key: DBCP-544 > URL: https://issues.apache.org/jira/browse/DBCP-544 > Project: Commons DBCP > Issue Type: Bug > Reporter: Akram > Priority: Critical > > =C2=A0 > Hi, > I have Custom SharedClassLoader in Tomcat 7 to load shared library jars, > which is used by different applications in that tomcat. We migrated to > Tomcat 9, now it is not working. How to achieve the same functionality i= n > tomcat 9. > In Tomcat 9 it expects resources to be passed. I don't find any sample Co= de > on how to populate resources. > I tried like below > public CustomSharedClassLoader(ClassLoader parent) throws Exception { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 super(parent); > //The below three lines are added by me to work for Tomcat 9. > =C2=A0 =C2=A0 =C2=A0 =C2=A0 StandardRoot standardRoot =3D new StandardRo= ot(); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 standardRoot.addPreResources(new DirResource= Set()); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 setResources(standardRoot);// End for tomcat= 9 changes. > =C2=A0 =C2=A0 =C2=A0 =C2=A0 for (URL urlForJars : getClassPath(SHARED_LIB= )) > { =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 addURL(urlForJars); =C2=A0 = =C2=A0 =C2=A0 =C2=A0 } > =C2=A0 =C2=A0 =C2=A0 =C2=A0 start(); > =C2=A0 =C2=A0 } > It didn't work. > public class CustomSharedClassLoader extends WebappClassLoader > {//Which takes shared folder libarary, it returns those classes.} -- This message was sent by Atlassian JIRA (v7.6.3#76005)