infojolt
infojolt

Reputation: 5418

ClassFormatException io.qameta.allure.aspects.StepsAspects: Invalid byte tag in constant pool: 18

I am trying to run a testng test using Spring for dependency injection. The dependency resolution is working as expected, but the console is full of log messages such as:

org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor error SEVERE: register definition failed org.aspectj.apache.bcel.classfile.ClassFormatException: File: 'io.qameta.allure.aspects.StepsAspects': Invalid byte tag in constant pool: 18 at org.aspectj.apache.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:261) at org.aspectj.apache.bcel.classfile.ClassParser.parse(ClassParser.java:162) at org.aspectj.apache.bcel.util.ClassLoaderRepository.loadClass(ClassLoaderRepository.java:288) at org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass(BcelWorld.java:369) at org.aspectj.weaver.bcel.BcelWorld.resolveDelegate(BcelWorld.java:338) at org.aspectj.weaver.ltw.LTWWorld.resolveDelegate(LTWWorld.java:97) at org.aspectj.weaver.World.resolveToReferenceType(World.java:378) at org.aspectj.weaver.World.resolve(World.java:271) at org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect(BcelWeaver.java:163)

Certain methods contain the annotation @Step which is used for generating details in an Allure report (the step annotation is in the io.qameta.allure package).

Dependencies:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>5.0.5.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-test</artifactId>
    <version>2.5</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-test</artifactId>
    <version>5.0.5.RELEASE</version>
    <scope>compile</scope>
</dependency>
    <groupId>org.aspectj</groupId>
    <artifactId>aspectjweaver</artifactId>
    <version>1.8.10</version>
</dependency>

How do I resolve the issue being identified in the console?

Upvotes: 0

Views: 1186

Answers (1)

infojolt
infojolt

Reputation: 5418

In the pom.xml file under:

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>

it contained the node:

<dependencies>
    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjweaver</artifactId>
        <version>${aspectj.version}</version>
    </dependency>
</dependencies>

Copying and pasting this dependency to the main <dependencies> node in /project/dependencies resolved the problem.

Upvotes: 1

Related Questions