Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 85261 invoked from network); 7 Nov 2009 13:10:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Nov 2009 13:10:13 -0000 Received: (qmail 77443 invoked by uid 500); 7 Nov 2009 13:10:12 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 77340 invoked by uid 500); 7 Nov 2009 13:10:11 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 77330 invoked by uid 99); 7 Nov 2009 13:10:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Nov 2009 13:10:11 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gscokart@gmail.com designates 209.85.219.227 as permitted sender) Received: from [209.85.219.227] (HELO mail-ew0-f227.google.com) (209.85.219.227) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Nov 2009 13:10:08 +0000 Received: by ewy27 with SMTP id 27so2387137ewy.23 for ; Sat, 07 Nov 2009 05:09:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=z5AvGDmNhlLS7iN52uIvbpCjpE1ekHSn11AKRwOQXNM=; b=Bx3ijGDUkANykfvRnxCnUYSSmmtCyl/E87v/zvhRikVkPm7lYDExx+ELXU6/9AmOu4 N8KOjn9XeZD3/mRRsZRNp7J0rRvCXGMWFV9tRso74NJgBVnbMFoLjPlwWoA8nByBLKn0 tVdFHzAWVUJlggpee0cv/VVV2lbLlP78c0t0Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=v8yX7FWY1EhLrVRO5XcH2j+1J6j2dawEk87F5yHAs5t29uEMhEmTaTv3bZRvLJe54G kW39ZCoJRi9jbetrmozn+bLDB4mrTDFsgK3djVbSiKIjFoUbyCns+CW9SB3MkkPFm1JK 1FTYBM1+edNJedKMqXfedG0EDSM41DyhlPFtk= MIME-Version: 1.0 Received: by 10.216.90.77 with SMTP id d55mr1812618wef.146.1257599387173; Sat, 07 Nov 2009 05:09:47 -0800 (PST) In-Reply-To: <877hu51qly.fsf@v35516.1blu.de> References: <26208572.post@talk.nabble.com> <877hu51qly.fsf@v35516.1blu.de> Date: Sat, 7 Nov 2009 14:09:47 +0100 Message-ID: Subject: Re: For every usage of Ant class api, different class loader From: Gilles Scokart To: Ant Developers List Content-Type: multipart/alternative; boundary=0016e6d7ea68be01cc0477c7acbb --0016e6d7ea68be01cc0477c7acbb Content-Type: text/plain; charset=ISO-8859-1 An other aproach is to specify a loader id when declaring the tasks in the parent project (and make sure your inherit this id in the subclass). Gilles Scokart 2009/11/5 Stefan Bodewig > On 2009-11-05, Raja Nagendra Kumar wrote: > > > When we are using Ant.java/class api Is it possible to explicitly set the > > new class loader, even if the initial classes existed in system > classloader( > > i.e though classpath or in ant lib directory.) > > > > The issue we are seeing is when we load our custom tasks though taskdef, > new > > classloader is being used for every programmatic ant call there fore > static > > blocks are reinitialised for every sub ant project, however when when we > > put it in lib or in system classpath, distinct classloader is not > > used..hence we have issue with some static code :) not being > reinitialized. > > Don't use static blocks 8-) > > Alternatively, don't make your jars available in the system classloader > or use the (deprecated) reverseloader attribute of taskdef. > > > Once we understand classloder behaviors in ant based on project vs > > subproject and TaskDef classpath way and systemclasspath way, then we > could > > be more confident to fix the current issue. > > It doesn't have any real relation to subprojects at all. Ant normally > delegates loading of any classes up the classloader chain. > > Stefan > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org > > --0016e6d7ea68be01cc0477c7acbb--