Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Trouble compiling java application with <iajc> task

Michael,

Thank you for your response. After debugging this for several more hours over
the past few days, I think I found what the problem was.

The imports that iajc was complaining about were not listed as inputs in my
build.xml file. After adding them, iajc compiled them fine. What's peculiar is
that the 'javac' task didn't complain about the missing input files. Perhaps
the 'javac' task searches for referenced, but missing, classes? I don't know,
just speculating.

Anyways, I was thrilled to have it finally compile late last night.

- Marshall


--- Michael McConnell <mcconnellem@xxxxxxxxx> wrote:
> Marshall -- 
> 
> I too was having a problem using the iajc task and Ant 1.6.1.
> 
> I never could get the <taskdef resource=....> to work correctly, so what I
> did was 
> simply define the following:
> 
> <taskdef name="iajc" classname="org.aspectj.tools.ant.taskdefs.AjcTask">
>   <classpath>
>    ... (included aspectjrt.jar as well as aspectjtools.jar)
>   </classpath>
> </taskdef>
> 
> Then the ant build script ran fine.
> 
> HTH.
> -Michael
> --- Marshall Meier <marshall_meier@xxxxxxxxx> wrote:
> > Hello All,
> > 
> > My name is Marshall Meier. I currently support a medium-sized web
> application
> > for a local municipality. I would like to introduce aspects to the
> application,
> > beginning with logging.
> > 
> > The application is built using Ant (version 1.6). Before introducing any
> > aspects, I wanted to first build the application, as is, with the AspectJ
> > compiler (1.2). In the Ant script I swapped out the 'javac' task for the
> 'iajc'
> > task. Much to my chagrin Ant responded with several dozen compiler errors.
> Now,
> > when I changed the 'iajc' task back to 'javac', it compiled and built fine.
> I
> > am using the Sun JDK, 1.4.2_03.
> > 
> > When compiling with iajc, most of the classes compiled fine. However with a
> few
> > of them I would get:
> > 
> > [iajc] [error] "ClassA.java error The import ClassB cannot be resolved."
> > 
> > Where ClassA.java would import ClassB.java.
> > 
> > I'm confident my AspectJ installation works, as I have compiled and
> executed a
> > few sample aspects I've written.
> > 
> > Any ideas? Does AspectJ exhibit any different behavior than the Java
> compiler
> > when it comes to imports? I spent a few hours "Googling" for help, but was
> > unsuccessful. Below is the iajc task I used.
> > 
> > <iajc srcdir="${compile.src.dir}"
> >       destdir="${compile.classes.dir}" verbose="yes">
> >       <classpath refid="${compile.classpath}" />
> >       <classpath>
> >           <pathelement location="${lib.dir}/aspectjrt.jar" />
> >       </classpath>
> >       <patternset refid="${compile.files}" />
> > </iajc>
> > 
> > Also, here's how I get access to the 'iajc' task in the Ant script
> > 
> > <taskdef
> resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties"> 
> >   
> >         <classpath>
> >               <pathelement location="jars/aspectjtools.jar" />
> >         </classpath>
> > </taskdef>
> > 
> > 
> > - Marshall
> > 
> > 
> > _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@xxxxxxxxxxx
> > http://dev.eclipse.org/mailman/listinfo/aspectj-users
> > 
> 
> 
> =====



Back to the top