gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 11:19:17 27 4
gpt4 key购买 nike

我正在尝试使用 Spring 进行依赖注入(inject)运行 testng 测试。依赖项解析按预期工作,但控制台充满了日志消息,例如:

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)

某些方法包含注释@Step,用于在Allure报告中生成详细信息(步骤注释位于io.qameta.allure包中)。

依赖关系:

<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>

如何解决控制台中发现的问题?

最佳答案

pom.xml文件位于:

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

它包含节点:

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

将此依赖项复制并粘贴到主 <dependencies>节点位于 /project/dependencies解决了问题。

关于java - ClassFormatException io.qameta.allure.aspects.StepsAspects : Invalid byte tag in constant pool: 18,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50047585/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com