Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 39597 invoked from network); 4 May 2004 09:30:41 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 4 May 2004 09:30:41 -0000 Received: (qmail 14057 invoked by uid 500); 4 May 2004 09:30:05 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 14015 invoked by uid 500); 4 May 2004 09:30:04 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 13985 invoked from network); 4 May 2004 09:30:03 -0000 Received: from unknown (HELO mail27.messagelabs.com) (193.109.254.147) by daedalus.apache.org with SMTP; 4 May 2004 09:30:03 -0000 X-VirusChecked: Checked X-Env-Sender: CVedovini@odyssey-group.com X-Msg-Ref: server-23.tower-27.messagelabs.com!1083663014!10323242 X-StarScan-Version: 5.2.10; banners=-,-,- X-Originating-IP: [62.50.73.22] Received: (qmail 17465 invoked from network); 4 May 2004 09:30:14 -0000 Received: from w1242.oams.com (62.50.73.22) by server-23.tower-27.messagelabs.com with SMTP; 4 May 2004 09:30:14 -0000 Received: by w1242.oams.com with Internet Mail Service (5.5.2657.72) id ; Tue, 4 May 2004 11:30:14 +0200 Message-ID: <7867C535D856D611A1240002B39B0EC201081074@w1241.oams.com> From: Claude Vedovini To: 'Ant Users List' Subject: RE: Antlib & ClassLoading issues Date: Tue, 4 May 2004 11:29:08 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C431BA.407909AE" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C431BA.407909AE Content-Type: text/plain; charset="iso-8859-1" Hi, Actually I tried to modify the code for the task, initializing the coreloader of the called build this does not seems to be enough. Thanks for the hint, seems like I used the core loader for nothing since two years :-) Anyhow, could someone tell me how to set the classloader for the whole stuff? Thanks in advance, Claude > -----Original Message----- > From: Peter Reilly [mailto:peter.reilly@corvil.com] > Sent: 4 May 2004 10:57 > To: Ant Users List > Subject: Re: Antlib & ClassLoading issues > > > Hi, > I did not know that the coreloader was actually used. > See: > http://marc.theaimsgroup.com/?l=ant-dev&m=107451990930463&w=2 > for some discussion on this. > > Be that as is may, if the coreloader is in the code, it should be > passed to the child projects. > > As a work-around, you could trigger the loading of the antlib > tasks and types > in the initial project: For example add a macro to the > antlib : "init" > > > > > > > and call it in the initial project: > > > > > > > > > It may be better to do something like this in any case, > otherwise the tasks/types > will be loaded in each of the sub-projects. > > Peter > > Claude Vedovini wrote: > > >I all, > > > >I am just trying to take advantage of the Antlib feature and > it seems that > >in certain circumstances it does not work as expected :-) > > > >Ok, here is the background: > > > >We built a nice continuous integration infrastructure using > ant, which is > >driven by a web application (our build launcher, currently > running with > >Websphere, Weblogic and Tomcat) we also developed some tasks that are > >automatically put in the context of the build by our launcher. > >Grosso-modo the launcher is a servlet that creates a Project > instance, > >configures it and so on. > >As you can imagine it also uses the setCoreLoader method to > give the Project > >the web-app ClassLoader (which is a non-delegating J2EE ClassLoader). > >All this used to work since two years or so... > > > >Those last days I tried to promote out own tasks to an > Antlib library in > >order to take advantage of the namespace stuff and here is > the problem I ran > >into: > > > > - When I declare my antlib: namespace in a "sub" build > (called via the > > task) I got a ClassNotFoundException (and Ant tells me that I > >certainly forgot to add a jar in the lib folder) > > > >I took a look at the task and it seems that the > CoreLoader of the > >calling project (which should further be used to load tasks > I guess) is not > >passed through to the called project. Taskdefs are, which > explains why it > >was working previously, but as I guess that antlibs are > loaded on request > >(when the namespace declaration is met) and using the > project's ClassLoader > >then my tasks' classes are no more in the scope. > > > >I am not 100% sure the problem lies where I think, so if > someone could have > >a look (or two) at that issue I think it could help (at least me ;-) > > > > > >Thanks in advance, > >Claude > >_____________________________________________________________ > _____________ > >* This email and any files transmitted with it are > CONFIDENTIAL and intended > >solely for the use of the individual or entity to which they > are addressed. > >* Any unauthorized copying, disclosure, or distribution of > the material > >within > >this email is strictly forbidden. > >* Any views or opinions presented within this e-mail are > solely those of the > >author and do not necessarily represent those of Odyssey > Asset Management > >Systems SA unless otherwise specifically stated. > >* An electronic message is not binding on its sender. Any > message referring > >to > >a binding engagement must be confirmed in writing and duly signed. > >* If you have received this email in error, please notify the sender > >immediately > >and delete the original. > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > __________________________________________________________________________ * This email and any files transmitted with it are CONFIDENTIAL and intended solely for the use of the individual or entity to which they are addressed. * Any unauthorized copying, disclosure, or distribution of the material within this email is strictly forbidden. * Any views or opinions presented within this e-mail are solely those of the author and do not necessarily represent those of Odyssey Asset Management Systems SA unless otherwise specifically stated. * An electronic message is not binding on its sender. Any message referring to a binding engagement must be confirmed in writing and duly signed. * If you have received this email in error, please notify the sender immediately and delete the original. ------_=_NextPart_001_01C431BA.407909AE--