AspectJ Internal Error: unable to add stackmap attributes. null
Hi , guys
I setup Java 1.8 and can't run UI test with Allure. Seems that AspectJ and java 1.8 issue. Then I run test. I have error:
Maven Settings:
<compiler.version>1.7</compiler.version>
<allure.version>1.4.4</allure.version>
<aspectj.version>1.8.4</aspectj.version>
... ... TestNG 6.8.2beta_20130330_0839 by C�dric Beust ([email protected]) ...
AspectJ Internal Error: unable to add stackmap attributes. null
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project ui-test: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test failed: There was an error in the forked process
[ERROR] java.lang.VerifyError: Expecting a stackmap frame at branch target 56
[ERROR] Exception Details:
[ERROR] Location:
[ERROR] com/zoomdata/base/CustomTestListener.onTestFailure(Lorg/testng/ITestResult;)V @44: ifnull
[ERROR] Reason:
[ERROR] Expected stackmap frame at this location.
[ERROR] Bytecode:
[ERROR] 0000000: 2ab7 0010 572a b400 04bb 0005 59b7 0006
[ERROR] 0000010: 1211 b600 082b b900 0e01 00b6 0008 b600
[ERROR] 0000020: 0bb9 000c 0200 2bb9 0012 0100 c600 0c2b
[ERROR] 0000030: b900 1201 00b6 0013 b1
[ERROR]
[ERROR] at java.lang.Class.getDeclaredConstructors0(Native Method)
[ERROR] at java.lang.Class.privateGetDeclaredConstructors(Class.java:2658)
[ERROR] at java.lang.Class.getConstructor0(Class.java:2964)
[ERROR] at java.lang.Class.newInstance(Class.java:403)
[ERROR] at org.testng.internal.ClassHelper.newInstance(ClassHelper.java:49)
[ERROR] at org.testng.TestRunner.initListeners(TestRunner.java:324)
[ERROR] at org.testng.TestRunner.init(TestRunner.java:238)
[ERROR] at org.testng.TestRunner.init(TestRunner.java:205)
[ERROR] at org.testng.TestRunner.<init>(TestRunner.java:153)
[ERROR] at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:522)
[ERROR] at org.testng.SuiteRunner.init(SuiteRunner.java:157)
[ERROR] at org.testng.SuiteRunner.<init>(SuiteRunner.java:111)
[ERROR] at org.testng.TestNG.createSuiteRunner(TestNG.java:1299)
[ERROR] at org.testng.TestNG.createSuiteRunners(TestNG.java:1286)
[ERROR] at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
[ERROR] at org.testng.TestNG.run(TestNG.java:1057)
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:293)
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:91)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
@apanashchenko please check that you're using the latest Allure version (1.4.3 or better 1.4.4). We recently updated AspectJ to 1.8.3 (https://github.com/allure-framework/allure-core/blob/master/allure-java-aspects/pom.xml#L15). AspectJ 1.8.x series is expected to correctly work with JDK 1.8. Also check that you also have AspectJ 1.8.x in pom.xml. Did it help?
@vania-pooh aspectJ 1.8.3 since allure 1.4.4
Unfortunately, it's doesn't helped Maven:
<compiler.version>1.8</compiler.version>
<allure.version>1.4.4</allure.version>
<aspectj.version>1.8.3</aspectj.version>
maven-surefire-plugin AspectJ settings:
<argLine>
-javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
</argLine>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
@apanashchenko hmm, very strange. Probably that's an unresolved issue in AspectJ. Allure code is compiled with JDK 1.7.
@vania-pooh I thinks yes
@apanashchenko any changes? Could you please provide an example of project to reproduce the problem?
@baev unfortunately no( try to run any test with dependency: < compiler.version >1.8< /compiler.version > < allure.version >1.4.4< /allure.version > < aspectj.version >1.8.3< /aspectj.version >
Could you please provide an example project to reproduce the problem?
@baev unfortunately no(
@apanashchenko change the aspectJ version to 1.8.3 and execute two commands sequentially : mvn clean, mvn install. It worked in my case. This error as I understand it occurs when you first compile after you enable the annotation Step in any class project.
@baev you can close this issue. My internal dependency use org.aspectj with an older version, I excluded this and all works fine! Thanks