On 10/11/07, Roland Piazzi <[EMAIL PROTECTED]> wrote:
> I try to run the aspectj-compiler with ant but it gives me the following
> error:
>
> A class needed by class org.aspectj.tools.ant.taskdefs.compilers.Ajc can not
> be found:
> org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter
>
>
> This class is contained within the file ant.jar which also is in a
> lib-folder which is added to the path.
>
> I don't know how to go on, hope that someone can help me about this?
>
> I attach my build file... http://www.nabble.com/file/p13155870/build.xml
> build.xml
Sounds like a classloader issue (just a guess). You don't specify a
classpath when you taskdef Ajc, which implies that it's on the Java
classpath, while Ant's classes are loaded from a classloader "higher"
level classloader.
<taskdef name="ajc" classname="org.aspectj.tools.ant.taskdefs.compilers.Ajc">
</taskdef>
I thought Ant set the context class loader to its classloader, so Ajc
should be able to see the Ant classes... Are you sure you are not
mixing up several versions of Ant on the classpath?
Try running Ant with the switch to disables the use of a global
CLASSPATH, and explicitly tell Ant where the jar for Ajc is, either:
(1) in the taskdef, (2) via -lib on the command line, or (3) by
putting the jar in $ANT_HOME/lib. If none of these methods work,
that's a more difficult issue likely related to a bad classpath (or
issues in Ajc). --DD
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]