ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <>
Subject Re: Antlib & ClassLoading issues
Date Tue, 04 May 2004 08:57:00 GMT
I did not know that the coreloader was actually used.
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"

<macrodef name="init">

 and call it in the initial project:

<project xmlns:s="" default="subs">
  <target name="subs">
    <subant ../>

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.


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
> - When I declare my antlib: namespace in a "sub" build (called via the
><ant> 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 <ant> 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,
>* 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
>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
>a binding engagement must be confirmed in writing and duly signed.
>* If you have received this email in error, please notify the sender
>and delete the original.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message