Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 5487 invoked from network); 30 Sep 2005 23:49:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Sep 2005 23:49:50 -0000 Received: (qmail 11550 invoked by uid 500); 30 Sep 2005 23:49:48 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 10626 invoked by uid 500); 30 Sep 2005 23:49:45 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 10615 invoked by uid 99); 30 Sep 2005 23:49:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Sep 2005 16:49:45 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [210.86.15.58] (HELO mta206-rme.xtra.co.nz) (210.86.15.58) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Sep 2005 16:49:50 -0700 Received: from mta4-rme.xtra.co.nz ([210.86.15.193]) by mta206-rme.xtra.co.nz with ESMTP id <20050930234921.JQUN28153.mta206-rme.xtra.co.nz@mta4-rme.xtra.co.nz>; Sat, 1 Oct 2005 11:49:21 +1200 Received: from [10.1.1.5] ([222.152.245.164]) by mta4-rme.xtra.co.nz with ESMTP id <20050930234920.BXTL5449.mta4-rme.xtra.co.nz@[10.1.1.5]>; Sat, 1 Oct 2005 11:49:20 +1200 Subject: Re: Classloading regression between commons-digester-1.0 and later versions From: Simon Kitching Reply-To: skitching@apache.org To: Jan.Luehe@Sun.COM Cc: Jakarta Commons Users List In-Reply-To: <433C7645.2030407@sun.com> References: <42C1E96D.5020301@sun.com> <433C2535.3010204@sun.com> <433C7645.2030407@sun.com> Content-Type: text/plain Date: Sat, 01 Oct 2005 11:49:29 +1200 Message-Id: <1128124169.3855.4.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Thu, 2005-09-29 at 16:18 -0700, Jan Luehe wrote: > Hi Craig, > > Craig McClanahan wrote On 09/29/05 15:44,: > > Hi Jan :-), > > > > On 9/29/05, *Jan Luehe* > > > wrote: > > > > > > Can someone explain to me the motivation for setting the > > "useContextClassLoader" property to FALSE by default? > > > > The motivation was this -- in a J2SE (now, Java SE) application, there > > may not be a thread context class loader at all, or it might have > > completely different semantics than what the EE specs require for a > > servlet container's thread context class loader. It seemed safer to > > avoid potential class loading mysteries to implement this as the default. > > thanks for your reply. > > Do you think it would have made sense for Digester to also consider > a "useContextClassLoader" system property (which would be overridden > by the Digester's "useContextClassLoader" property)? > > This would allow code that runs in an EE environment and relies on > the digester being able to load classes from WEB-INF/lib to continue > to work with later commons-digester versions, by setting the > "useContextClassLoader" system property to TRUE. This would be useful > in cases where one does not have any control over the code that > acquires a digester. > It's not safe to put digester in the container path and expose this to components. Digester uses BeanUtils which uses lots of static variables. Any library that uses static variables is a very *bad* thing to place in a path that is shared by multiple supposedly independent components. I think that allowing a container to expose classes which are not part of the container specification is a really bad idea in any case: * http://wiki.apache.org/jakarta-commons/Logging/UndeployMemoryLeak Why do you have a need to expose digester to components rather than let components which want to use digester bundle it in WEB-INF/lib themselves? Regards, Simon --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org