Recently, I have upgraded to the java version OpenJDK version “17.0.1” 2021-10-19 IBM Semeru Runtime Open Edition 17.0.1.0 (build 17.0.1+12) Eclipse OpenJ9 VM 17.0.1.0 (build openj9-0.29.1, JRE 17 Windows 10 amd64-64-Bit Compressed References 20211207_55 (JIT enabled, AOT enabled)
Jmeter 5.4.3 is giving follow error in logs when running any JMX file. Any idea how to resolve this issue?
022-06-09 07:59:31,354 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[ProgramServices Case 1-1,6,main] org.codehaus.groovy.GroovyBugError: BUG! exception in phase ‘semantic analysis’ in source unit ‘Script2.groovy’ Unsupported class file major version 61 at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:905) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:627) ~[groovy-3.0.7.jar:3.0.7] at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:389) ~[groovy-3.0.7.jar:3.0.7] at groovy.lang.GroovyClassLoader.lambda$parseClass$3(GroovyClassLoader.java:332) ~[groovy-3.0.7.jar:3.0.7] at groovy.lang.GroovyClassLoader$$Lambda$539/0x00000000cfbb0448.provide(Unknown Source) ~[?:?] at org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154) ~[groovy-3.0.7.jar:3.0.7] at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:330) ~[groovy-3.0.7.jar:3.0.7] at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:314) ~[groovy-3.0.7.jar:3.0.7] at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:257) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getScriptClass(GroovyScriptEngineImpl.java:336) ~[groovy-jsr223-3.0.7.jar:3.0.7] at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.compile(GroovyScriptEngineImpl.java:181) ~[groovy-jsr223-3.0.7.jar:3.0.7] at org.apache.jmeter.util.JSR223TestElement.processFileOrScript(JSR223TestElement.java:211) ~[ApacheJMeter_core.jar:5.4.3] at org.apache.jmeter.visualizers.JSR223Listener.sampleOccurred(JSR223Listener.java:54) ~[ApacheJMeter_components.jar:5.4.3] at org.apache.jmeter.threads.ListenerNotifier.notifyListeners(ListenerNotifier.java:58) ~[ApacheJMeter_core.jar:5.4.3] at org.apache.jmeter.threads.JMeterThread.notifyListeners(JMeterThread.java:1024) ~[ApacheJMeter_core.jar:5.4.3] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:579) ~[ApacheJMeter_core.jar:5.4.3] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) ~[ApacheJMeter_core.jar:5.4.3] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) ~[ApacheJMeter_core.jar:5.4.3] at java.lang.Thread.run(Thread.java:884) [?:?] Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 61 at groovyjarjarasm.asm.ClassReader.(ClassReader.java:189) ~[groovy-3.0.7.jar:3.0.7] at groovyjarjarasm.asm.ClassReader.(ClassReader.java:170) ~[groovy-3.0.7.jar:3.0.7] at groovyjarjarasm.asm.ClassReader.(ClassReader.java:156) ~[groovy-3.0.7.jar:3.0.7] at groovyjarjarasm.asm.ClassReader.(ClassReader.java:277) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.ast.decompiled.AsmDecompiler.parseClass(AsmDecompiler.java:81) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ClassNodeResolver.findDecompiled(ClassNodeResolver.java:251) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ClassNodeResolver.tryAsLoaderClassOrScript(ClassNodeResolver.java:189) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ClassNodeResolver.findClassNode(ClassNodeResolver.java:169) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ClassNodeResolver.resolveName(ClassNodeResolver.java:125) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.resolveToOuter(ResolveVisitor.java:871) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:506) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.resolveFromDefaultImports(ResolveVisitor.java:663) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.resolveFromDefaultImports(ResolveVisitor.java:626) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:505) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:468) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:338) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:330) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:326) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.transformConstructorCallExpression(ResolveVisitor.java:1239) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:902) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.transformBinaryExpression(ResolveVisitor.java:1207) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:896) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitExpressionStatement(ClassCodeExpressionTransformer.java:108) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:86) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:164) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.visitBlockStatement(ResolveVisitor.java:1564) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:138) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:111) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(ClassCodeExpressionTransformer.java:66) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.visitConstructorOrMethod(ResolveVisitor.java:294) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:106) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.ast.ClassNode.visitMethods(ClassNode.java:1099) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1092) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:52) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1473) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:262) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.CompilationUnit.lambda$new$16(CompilationUnit.java:738) ~[groovy-3.0.7.jar:3.0.7] at org.codehaus.groovy.control.CompilationUnit$$Lambda$565/0x00000000d4bc5fe0.call(Unknown Source) ~[?:?] at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:901) ~[groovy-3.0.7.jar:3.0.7]
Advertisement
Answer
- JMeter 5.4.3 comes with Groovy 3.0.7 which was released in December 2020
- You’re using Java 17 which was released in September 2021
You’re getting the error due to lack of support of Java 17 in Groovy so you either need to:
- downgrade your Java version (the minimum Java version you can run JMeter 5.4.x with is Java 8)
- switch to Nightly build of JMeter
- manually upgrade Groovy libraries in JMeter Classpath