org.aspectj.apache.bcel.classfile.ClassFormatException:常量池中的无效字节标记:19

时间:2018-10-19 20:06:49

标签: maven selenium

mvn clean runselenium-java更新为3.13后,我在3.14上遇到异常

org.aspectj.apache.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
at org.aspectj.apache.bcel.classfile.Constant.readConstant(Constant.java:139)
at org.aspectj.apache.bcel.classfile.ConstantPool.<init>(ConstantPool.java:98)
at org.aspectj.apache.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:186)
at org.aspectj.apache.bcel.classfile.ClassParser.parse(ClassParser.java:131)
at org.aspectj.weaver.bcel.Utility.makeJavaClass(Utility.java:467)
at org.aspectj.weaver.bcel.UnwovenClassFile.getJavaClass(UnwovenClassFile.java:68)
at org.aspectj.weaver.bcel.BcelWeaver.addClassFile(BcelWeaver.java:453)
at org.aspectj.weaver.bcel.BcelWeaver.addJarFile(BcelWeaver.java:400)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.initBcelWorld(AjBuildManager.java:896)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:249)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:185)
at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:114)
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:537)
at com.browserstack.automate.mojo.AutomateBaseMojo.execute(AutomateBaseMojo.java:114)
at com.browserstack.automate.mojo.AutomateTestCompileMojo.execute(AutomateTestCompileMojo.java:19)
at 

我仍然可以使用testngRunner运行测试。

1 个答案:

答案 0 :(得分:0)

在maven中更新Aspectj依赖关系可以帮助我解决此问题

<dependency>
   <groupId>org.aspectj</groupId>
    <artifactId>aspectjtools</artifactId>
    <version>1.9.1</version>
</dependency>
<dependency>
   <groupId>org.aspectj</groupId>
   <artifactId>aspectjweaver</artifactId>
   <version>1.9.1</version>
</dependency>