Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] ANT-Task problem

This looks like a known bug (in Eclipse?):

  https://bugs.eclipse.org/bugs/show_bug.cgi?id=34246

The workaround is to fork the iajc task to avoid
the eclipse JDT libraries in the parent class loader:

    <iajc
        fork="true"
        forkclasspath="${aspectjtools.jar}"
        destDir="${dir.compile.source}"
        classpath="${jar.aspectjrt}">
        ...

Does that work for you?

Wes

Cyrill Ruettimann wrote:

Hello,

I have problems setting up the ANT-Task for the ajc within Eclipse 2.1.1.

1. Added aspectjtools.jar and aspectjrt.jar to the ant classpath (Window/Preferences/Ant).

Following the  build.xml:

jar.aspectjtools=/opt/eclipse_211/plugins/org.aspectj.ajde_1.1.3/aspectjtools.jar
jar.aspectjrt=/opt/eclipse_211/plugins/org.aspectj.ajde_1.1.3/aspectjrt.jar

<taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
    <classpath>
        <pathelement path="${aspectjtools.jar}" />
    </classpath>
</taskdef>

<target name="compile_aspect" depends="init,configuration"
			description="Compiles the source code with aspects">
    <iajc destDir="${dir.compile.source}" classpath="${jar.aspectjrt}">
        <sourceroots>
	    <pathelement location="${dir.source}" />
	    <pathelement location="${dir.aspectj}" />
	</sourceroots>
        <classpath>
	    <pathelement location="${jar.junit}"/>
        </classpath>
    </iajc>
</target>


I have also set the AspectJ libraries to /usr/local/aspectj/lib where I installed the AspectJ 1.1 Release. The same behaviour.

Whenever I run the build.xml inside of Eclipse, the compilation fails. If I run the ant script fromt the command line, the ant script succeeds.

Buildfile: /home/cyrill/workspace/VMUnit/build.xml

init:

configuration:

compile_aspect:
        [iajc] ABORT
        [iajc] Exception thrown from AspectJ 1.1.0
[iajc] [iajc] This might be logged as a bug already -- find current bugs at [iajc] http://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&component=Compiler [iajc] [iajc] Bugs for exceptions thrown have titles File:line from the top stack, [iajc] e.g., "SomeFile.java:243" [iajc] [iajc] If you don't find the exception below in a bug, please add a new bug
        [iajc] at http://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ
        [iajc] To make the bug a priority, please include a test program
        [iajc] that can reproduce this exception.
[iajc] (class: org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment, method: createBinaryTypeFrom signature: (Lorg/eclipse/jdt/internal/compiler/env/IBinaryType;Lorg/eclipse/jdt/internal/compiler/lookup/PackageBinding;Z)Lorg/eclipse/jdt/internal/compile [iajc] (class: org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment, method: createBinaryTypeFrom signature: (Lorg/eclipse/jdt/internal/compiler/env/IBinaryType;Lorg/eclipse/jdt/internal/compiler/lookup/PackageBinding;Z)Lorg/eclipse/jdt/internal/compile [iajc] java.lang.VerifyError: (class: org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment, method: createBinaryTypeFrom signature: (Lorg/eclipse/jdt/internal/compiler/env/IBinaryType;Lorg/eclipse/jdt/internal/compiler/lookup/PackageBinding;Z)Lorg/eclipse/jdt/internal/compile [iajc] at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:351) [iajc] at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:133) [iajc] at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:78) [iajc] at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:106) [iajc] at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:60)
        [iajc] 	at org.aspectj.tools.ajc.Main.run(Main.java:217)
        [iajc] 	at org.aspectj.tools.ajc.Main.runMain(Main.java:155)
[iajc] at org.aspectj.tools.ant.taskdefs.AjcTask.executeInSameVM(AjcTask.java:990) [iajc] at org.aspectj.tools.ant.taskdefs.AjcTask.execute(AjcTask.java:863)
        [iajc] 	at org.apache.tools.ant.Task.perform(Task.java:341)
        [iajc] 	at org.apache.tools.ant.Target.execute(Target.java:309)
        [iajc] 	at org.apache.tools.ant.Target.performTasks(Target.java:336)
[iajc] at org.apache.tools.ant.Project.executeTarget(Project.java:1339) [iajc] at org.apache.tools.ant.Project.executeTargets(Project.java:1255) [iajc] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:569) [iajc] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:367)
        [iajc] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[iajc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [iajc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        [iajc] 	at java.lang.reflect.Method.invoke(Method.java:324)
        [iajc] 	at org.eclipse.ant.core.AntRunner.run(AntRunner.java:335)
[iajc] at org.eclipse.ui.externaltools.internal.ant.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:172)
        [iajc] 	at java.lang.Thread.run(Thread.java:534)
[iajc] [iajc] BUILD FAILED: file:/home/cyrill/workspace/VMUnit/build.xml:63: fail due to VerifyError "(class: org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment, method: createBinaryTypeFrom signature: (Lorg/eclipse/jdt/internal/compiler/env/IBinaryType;Lorg/eclipse/jdt/internal/compiler/lookup/PackageBinding;Z)Lorg/eclipse/jdt/internal/compile""ABORT" (1 exceptions)
Total time: 4 seconds

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top