From users-return-267360-archive-asf-public=cust-asf.ponee.io@tomcat.apache.org Tue Apr 16 18:28:42 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 EC86E180630 for ; Tue, 16 Apr 2019 20:28:41 +0200 (CEST) Received: (qmail 60899 invoked by uid 500); 16 Apr 2019 18:28:38 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 60888 invoked by uid 99); 16 Apr 2019 18:28:38 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Apr 2019 18:28:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id EC9C1C22AD for ; Tue, 16 Apr 2019 18:28:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.294 X-Spam-Level: ** X-Spam-Status: No, score=2.294 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.006, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id ALTINldnS_0V for ; Tue, 16 Apr 2019 18:28:36 +0000 (UTC) Received: from mail-it1-f196.google.com (mail-it1-f196.google.com [209.85.166.196]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id BF8C160EB5 for ; Tue, 16 Apr 2019 16:41:45 +0000 (UTC) Received: by mail-it1-f196.google.com with SMTP id y134so34059809itc.5 for ; Tue, 16 Apr 2019 09:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=E2D3VNSjVdnuB5Sl6GReqVxwQFbDoZURpx6shhc0C3c=; b=awDvsh96cRWzMqmpidByUiyBdH60eHnwbLrsQL4bOCrGokC6PGcxE36OLhLUNvGROA yek4H8YmYnEu0sA54xg4qoWK+Cg1NEmyC5I0P/PMX9nwgFtQyB36JfaPTA6FS6VHuyQ2 w8nzEgB8WKct2qD0zyzwOh1ero0esPJXWWyCZakIHh98GSfN2VqkjkjXXxQ4mG0ika9h HvuGdunZKzkMDRIACT9L7l90in+uyAIZOHkEgMVZ5/nrUNseU6hnkghoh8dC4M60DUQa 3g2Whiha8D2SUzJYOyGKNRcJykZMTyQeq8JeIwu9fX5NFmB4LijOuUJMBRMx7mZM6Aja 6zHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=E2D3VNSjVdnuB5Sl6GReqVxwQFbDoZURpx6shhc0C3c=; b=ELuZ73kGHUbpkUeSXSThcv/cHLU1sgAR6So1IrmSX4nqAR32+bFcoka38ftmQTbg9J d5Puh0y4u7ZenZezO8juhYJpmAF1xjobMjvltbJF5vd8hZjBHaHr9TovkjzP/aowo68y WIZlBiAlrb7N5ggrqfIqB1zhXC+Z/FZzAPbmhTdC0Rs2bfzLEB6bWc3Uncumh6JYZtRT h6sct7rqY78SKipCjFonD5g4tnaKbzuzpZwJazs+bIVpFyrFopdVUi41sXzkfz041icz BpXzJUC8Y/kw3q1PsE1H+MFQ5oHY5VTs47nfxKZT8OyylzicuXcoeXO5mNCkUz8ZKzTU 6/bA== X-Gm-Message-State: APjAAAWcbxr2YFQn80+kAcVAm7MZcWsONOOglOnsC8Kgljzk67QKVAOF Op9tytjtP7d5X1JUQcDgq4JIpZbVQOtApnW1inF1wNL8Byw= X-Google-Smtp-Source: APXvYqzOrfckc3pKPXOj2xoIoUz8rfni5rYBMLeIjV/xsXh1d0MHongp+nTYfRkH75gvvjPkP1H0xIWpxQPMVphiCo0= X-Received: by 2002:a24:6987:: with SMTP id e129mr33365913itc.28.1555432899434; Tue, 16 Apr 2019 09:41:39 -0700 (PDT) MIME-Version: 1.0 References: <2439c16c-fb86-380c-1492-97d4388b5923@christopherschultz.net> In-Reply-To: <2439c16c-fb86-380c-1492-97d4388b5923@christopherschultz.net> From: Akram Hussain Date: Tue, 16 Apr 2019 22:11:27 +0530 Message-ID: Subject: Re: Upgrade from Tomcat 7 to Tomcat 9.0.17 To: Tomcat Users List Content-Type: multipart/alternative; boundary="000000000000715d3c0586a8713c" --000000000000715d3c0586a8713c Content-Type: text/plain; charset="UTF-8" Hi Christofer, I have gone through it, But it was not clear to me. If an example is provided, how to pass resources to SharedClassLoader, it could be helpful. Regards, Akram. On Tue, Apr 16, 2019 at 7:57 PM Christopher Schultz < chris@christopherschultz.net> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > Akram, > > On 4/16/19 06:29, Akram Hussain wrote: > > 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 in tomcat 9. > > Have a look at the which should be able to do what you > need without any custom code: > > http://tomcat.apache.org/tomcat-9.0-doc/config/resources.html > > > In Tomcat 9 it expects resources to be passed. I don't find any > > sample Code on how to populate resources. > > > > I tried like below > > > > public CustomSharedClassLoader(ClassLoader parent) throws Exception > > { super(parent); //The below three lines are added by me to work > > for Tomcat 9. StandardRoot standardRoot = new StandardRoot(); > > standardRoot.addPreResources(new DirResourceSet()); > > setResources(standardRoot);// End for tomcat 9 changes. > > > > for (URL urlForJars : getClassPath(SHARED_LIB)) { > > addURL(urlForJars); } start(); } > > > > It didn't work. > > > > public class CustomSharedClassLoader extends > > WebappClassLoader{//Which takes shared folder libarary, it returns > > those classes.} > > You should be able to ditch your custom ClassLoader entirely. > > - -chris > -----BEGIN PGP SIGNATURE----- > Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ > > iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAly15l4ACgkQHPApP6U8 > pFj9eRAAruPoNK9CF2Cy/aVM9eBuBWtlAC8j5Zgr/UGIb5XEQsYg/fw0SxiWC6lW > c7SV9jeUdptkqKPvqGDMb07/LSHobbuN1wrF/oWxDKJA9a8IltcI775ZxiCFAA7C > Fl//zP8rv/jXhGB+IyiH6OqbFRsC3tc630rsi4bVYMkaK58DuhvL9BpBWiobC7rF > YEQT+yNjqqLHO/SxN70Ar2/p7zNAiNdkv/wDkVFzdWhvqIYIekgeVMQr4GkcCLH6 > 9eNZb+lw9DBhTqJYYSBoolAs7nadYp3hTBgxRm5vyXl7ODSV0gZHXFoG9aEDYkgU > GCtltrGi0b32l+D3YDnMPjpdf1nc9A5No5cHXXdLi5LI1msEKcsfdHUA3Y30kxE3 > p1m/Y7iVD8R8jLYp1g0JPwXnwfoBhSd0WVTZhlB6i6MP4o/mAAgsqQ1bDlvNlWOL > 3l6drzE02zxJVk2RAVjSN/s1sCpsTOlldq8PwplQz8IZy3BHtrG2B2qMOVFkg4G2 > mupFaB+/E5Lay1VWzPdsSECB2aMtf/sTtix+E0MmwmlVK2NLA1AEZGPuim7cHY8h > lW8JyXp/DdfqCL7qA1SSDZhPefeNQkN41y0vfKNUurkYUTnYgcmtMYzZjm00udhR > QzDL4qfnn/DXen+SXp8YpbfsvCc8bIaWlxmVrnFB4+DZ2KpyYb4= > =XVmW > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --000000000000715d3c0586a8713c--