Mojo AspectJ Plugin

Corbertura Plugin fails to work when AspectJ plugin is enabled

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.0
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Activity

Hide
Dax Abraham added a comment -

Have tried with :

AspectJ Pluging: 1.0-beta-4-SNAPSHOT

and

Cobertura Plugin: 2.2-SNAPSHOT

But still no luck.

Show
Dax Abraham added a comment - Have tried with : AspectJ Pluging: 1.0-beta-4-SNAPSHOT and Cobertura Plugin: 2.2-SNAPSHOT But still no luck.
Hide
Janne Mattila added a comment -

We have this same problem. It makes cobertura reports pretty unusable at the moment. Any workarounds or resolutions appreciated.

Show
Janne Mattila added a comment - We have this same problem. It makes cobertura reports pretty unusable at the moment. Any workarounds or resolutions appreciated.
Hide
Frédéric Fondement added a comment -

Hello,

So do I with cobertura 2.4 used together with aspectj plugin 1.3.1.
Works well with aspectj plugin 1.3.

The problem appears while compiling tests with aspectj, after cobertura has instrumented "business" code (which is odd for "business" code could be both compiled with aspectj and then instrumented).

Here is an extract of the error (goal cobertura:cobertura):

[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory /var/lib/hudson/jobs/Storage/workspace/storage/target
[INFO] [cobertura:clean {execution: default}]
[INFO] Preparing cobertura:cobertura
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [aspectj:compile {execution: default}]
[WARNING] advice defined in com.mt.storage.KeyManagement has not been applied [Xlint:adviceDidNotMatch]
[WARNING] advice defined in com.mt.storage.ColumnFamiliyManagement has not been applied [Xlint:adviceDidNotMatch]
[WARNING] advice defined in com.mt.storage.IncrementManagement has not been applied [Xlint:adviceDidNotMatch]
[WARNING] advice defined in com.mt.storage.PersistingMixin has not been applied [Xlint:adviceDidNotMatch]
[INFO] [cobertura:instrument {execution: default-instrument}]
[INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Instrumenting 62 files to /var/lib/hudson/jobs/Storage/workspace/storage/target/generated-classes/cobertura
Cobertura: Saved information on 62 classes.
Instrument time: 443ms

[INFO] Instrumentation was successful.
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [aspectj:test-compile {execution: default}]
[ERROR] ABORT
3 mars 2011 14:58:11 org.aspectj.weaver.tools.Jdk14Trace info
INFO: Dumping to /var/lib/hudson/jobs/Storage/workspace/storage/./ajcore.20110303.145811.715.txt
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Compiler errors:
abort ABORT – (RuntimeException) Problem processing attributes in /var/lib/hudson/jobs/Storage/workspace/storage/target/generated-classes/cobertura/com/mt/storage/StorageManagement.class
Problem processing attributes in /var/lib/hudson/jobs/Storage/workspace/storage/target/generated-classes/cobertura/com/mt/storage/StorageManagement.class
java.lang.RuntimeException: Problem processing attributes in /var/lib/hudson/jobs/Storage/workspace/storage/target/generated-classes/cobertura/com/mt/storage/StorageManagement.class
at org.aspectj.weaver.bcel.BcelObjectType.ensureAspectJAttributesUnpacked(BcelObjectType.java:383)
at org.aspectj.weaver.bcel.BcelObjectType.<init>(BcelObjectType.java:160)
at org.aspectj.weaver.bcel.BcelWorld.buildBcelDelegate(BcelWorld.java:394)
at org.aspectj.weaver.bcel.BcelWorld.addSourceObjectType(BcelWorld.java:474)
at org.aspectj.weaver.bcel.BcelWorld.addSourceObjectType(BcelWorld.java:440)
at org.aspectj.weaver.bcel.BcelWeaver.isAspect(BcelWeaver.java:320)
at org.aspectj.weaver.bcel.BcelWeaver.addAspectsFromDirectory(BcelWeaver.java:299)
at org.aspectj.weaver.bcel.BcelWeaver.addLibraryJarFile(BcelWeaver.java:236)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.initBcelWorld(AjBuildManager.java:864)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:245)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181)
at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:112)
at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:60)
at org.aspectj.tools.ajc.Main.run(Main.java:371)
at org.aspectj.tools.ajc.Main.runMain(Main.java:248)
at org.codehaus.mojo.aspectj.AbstractAjcCompiler.execute(AbstractAjcCompiler.java:370)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:1205)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:1038)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:643)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: java.lang.ClassCastException: org.aspectj.apache.bcel.classfile.ConstantFieldref cannot be cast to org.aspectj.apache.bcel.classfile.ConstantUtf8
at org.aspectj.apache.bcel.classfile.ConstantPool.getConstantUtf8(ConstantPool.java:223)
at org.aspectj.weaver.bcel.BcelConstantPoolReader.readUtf8(BcelConstantPoolReader.java:31)
at org.aspectj.weaver.VersionedDataInputStream.readUtf8(VersionedDataInputStream.java:61)
at org.aspectj.weaver.ResolvedMemberImpl.readResolvedMember(ResolvedMemberImpl.java:500)
at org.aspectj.weaver.NewFieldTypeMunger.readField(NewFieldTypeMunger.java:59)
at org.aspectj.weaver.ResolvedTypeMunger.read(ResolvedTypeMunger.java:152)
at org.aspectj.weaver.AjAttribute.read(AjAttribute.java:117)
at org.aspectj.weaver.bcel.Utility.readAjAttributes(Utility.java:101)
at org.aspectj.weaver.bcel.BcelObjectType.ensureAspectJAttributesUnpacked(BcelObjectType.java:379)
... 38 more

Show
Frédéric Fondement added a comment - Hello, So do I with cobertura 2.4 used together with aspectj plugin 1.3.1. Works well with aspectj plugin 1.3. The problem appears while compiling tests with aspectj, after cobertura has instrumented "business" code (which is odd for "business" code could be both compiled with aspectj and then instrumented). Here is an extract of the error (goal cobertura:cobertura): [INFO] [clean:clean {execution: default-clean}] [INFO] Deleting directory /var/lib/hudson/jobs/Storage/workspace/storage/target [INFO] [cobertura:clean {execution: default}] [INFO] Preparing cobertura:cobertura [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 0 resource [INFO] [compiler:compile {execution: default-compile}] [INFO] Nothing to compile - all classes are up to date [INFO] [aspectj:compile {execution: default}] [WARNING] advice defined in com.mt.storage.KeyManagement has not been applied [Xlint:adviceDidNotMatch] [WARNING] advice defined in com.mt.storage.ColumnFamiliyManagement has not been applied [Xlint:adviceDidNotMatch] [WARNING] advice defined in com.mt.storage.IncrementManagement has not been applied [Xlint:adviceDidNotMatch] [WARNING] advice defined in com.mt.storage.PersistingMixin has not been applied [Xlint:adviceDidNotMatch] [INFO] [cobertura:instrument {execution: default-instrument}] [INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file Instrumenting 62 files to /var/lib/hudson/jobs/Storage/workspace/storage/target/generated-classes/cobertura Cobertura: Saved information on 62 classes. Instrument time: 443ms [INFO] Instrumentation was successful. [INFO] [resources:testResources {execution: default-testResources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 5 resources [INFO] [compiler:testCompile {execution: default-testCompile}] [INFO] Nothing to compile - all classes are up to date [INFO] [aspectj:test-compile {execution: default}] [ERROR] ABORT 3 mars 2011 14:58:11 org.aspectj.weaver.tools.Jdk14Trace info INFO: Dumping to /var/lib/hudson/jobs/Storage/workspace/storage/./ajcore.20110303.145811.715.txt [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Compiler errors: abort ABORT – (RuntimeException) Problem processing attributes in /var/lib/hudson/jobs/Storage/workspace/storage/target/generated-classes/cobertura/com/mt/storage/StorageManagement.class Problem processing attributes in /var/lib/hudson/jobs/Storage/workspace/storage/target/generated-classes/cobertura/com/mt/storage/StorageManagement.class java.lang.RuntimeException: Problem processing attributes in /var/lib/hudson/jobs/Storage/workspace/storage/target/generated-classes/cobertura/com/mt/storage/StorageManagement.class at org.aspectj.weaver.bcel.BcelObjectType.ensureAspectJAttributesUnpacked(BcelObjectType.java:383) at org.aspectj.weaver.bcel.BcelObjectType.<init>(BcelObjectType.java:160) at org.aspectj.weaver.bcel.BcelWorld.buildBcelDelegate(BcelWorld.java:394) at org.aspectj.weaver.bcel.BcelWorld.addSourceObjectType(BcelWorld.java:474) at org.aspectj.weaver.bcel.BcelWorld.addSourceObjectType(BcelWorld.java:440) at org.aspectj.weaver.bcel.BcelWeaver.isAspect(BcelWeaver.java:320) at org.aspectj.weaver.bcel.BcelWeaver.addAspectsFromDirectory(BcelWeaver.java:299) at org.aspectj.weaver.bcel.BcelWeaver.addLibraryJarFile(BcelWeaver.java:236) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.initBcelWorld(AjBuildManager.java:864) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:245) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181) at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:112) at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:60) at org.aspectj.tools.ajc.Main.run(Main.java:371) at org.aspectj.tools.ajc.Main.runMain(Main.java:248) at org.codehaus.mojo.aspectj.AbstractAjcCompiler.execute(AbstractAjcCompiler.java:370) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:1205) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:1038) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:643) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: java.lang.ClassCastException: org.aspectj.apache.bcel.classfile.ConstantFieldref cannot be cast to org.aspectj.apache.bcel.classfile.ConstantUtf8 at org.aspectj.apache.bcel.classfile.ConstantPool.getConstantUtf8(ConstantPool.java:223) at org.aspectj.weaver.bcel.BcelConstantPoolReader.readUtf8(BcelConstantPoolReader.java:31) at org.aspectj.weaver.VersionedDataInputStream.readUtf8(VersionedDataInputStream.java:61) at org.aspectj.weaver.ResolvedMemberImpl.readResolvedMember(ResolvedMemberImpl.java:500) at org.aspectj.weaver.NewFieldTypeMunger.readField(NewFieldTypeMunger.java:59) at org.aspectj.weaver.ResolvedTypeMunger.read(ResolvedTypeMunger.java:152) at org.aspectj.weaver.AjAttribute.read(AjAttribute.java:117) at org.aspectj.weaver.bcel.Utility.readAjAttributes(Utility.java:101) at org.aspectj.weaver.bcel.BcelObjectType.ensureAspectJAttributesUnpacked(BcelObjectType.java:379) ... 38 more
Hide
Frédéric Fondement added a comment -

A working configuration can be found on http://code.google.com/p/n-orm/source/browse/parent-aspect/pom.xml

First: mvn install
then mvn site-deploy -P coverage

Show
Frédéric Fondement added a comment - A working configuration can be found on http://code.google.com/p/n-orm/source/browse/parent-aspect/pom.xml First: mvn install then mvn site-deploy -P coverage

People

Vote (10)
Watch (10)

Dates

  • Created:
    Updated: