I got this `bytebuddy` error when executing BDD test

hello all, i need help.

i am trying to execute the BDD test using Katalon Studio Free v9.5.0, my Java/JRE version is v21
i got this error:

=============== ROOT CAUSE =====================
Caused by: java.lang.IncompatibleClassChangeError: class net.bytebuddy.implementation.FieldAccessor$FieldNameExtractor$ForBeanProperty$1 cannot inherit from final class net.bytebuddy.implementation.FieldAccessor$FieldNameExtractor$ForBeanProperty

For trouble shooting, please visit: https://docs.katalon.com/katalon-studio/docs/troubleshooting.html
================================================

the whole error message is attached on the picture

this is my 2nd day figuring out how to solve this issue, the error still happen.
thanks in advance
really appreciate for any help/answer

5 Likes

Hi there, :wave:

Thank you very much for your topic! It may take a little while before Katalon team member or others forum members respond to you.

In the meantime, you can double-check your post to see if you can add any extra information i.e. error logs, HTML codes, screenshots, etc. Check out this posting guide to help us help you better!

Thanks! :sunglasses:
Katalon Community team

2 Likes

Please try to stop using JRE version ‘v21’ inside Katalon Studio Free v9.5.0. Please let Katalon Studio Free v9.5.0 to run on the JRE bundled as default (possibly JDK17). Then hopefully the "java.lang.IncompatibleClassChangeError: class net.bytebuddy… " will disappear.

1 Like

hey @kazurayam thanks for the answer.

I’ve tried to change the JRE to use Katalon default, I got an error:

=============== ROOT CAUSE =====================
Caused by: java.lang.UnsupportedClassVersionError: META-INF/versions/21/com/fasterxml/jackson/core/io/doubleparser/FastDoubleSwar has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0

do you have idea what is this about?
thanks in advance

4 Likes

In the following page, you can find the list of class file versions for each JDK release.

So you can interpret the message as follows:

1 Like

I guess, you have some external library(ies) stored in the Drivers folder or the Plugins folder, and one of the jar desperately wants to be executed on JDK21. Your test case called a class in the jar. But you had to stop using JDK21 for the reason as above. So that one of the class that demands JDK21 complained about the version discrepancy.

Now you seem to be in a dead-lock situation.

I do not see what sort of external library you customly installed. I have no idea how to work around this mess.

2 Likes

Hi! I’m facing the exact same situation, but the project is not using any external drivers or plugins. I’ll try to use a previous version of Katalon, as a coworker had no issues with this.

3 Likes

In my case, going back to version 8.6.9 of Katalon was the solution.

To add details, I’m using Mac.

1 Like

Thank you for your input.

This implies that the Katalon Studio 9.5.0 has a problem natively, possibly around BDD/Cucumber libraries.

=> @Elly_Tran

1 Like

Hi all,

Thank you for sharing your issue. I will create a ticket for my team to investigate. Back to you soon

2 Likes

Hello,

I have exactly the same issue with Katalon 9.7.2

With default Java or Java 17:
java.lang.UnsupportedClassVersionError: META-INF/versions/21/com/fasterxml/jackson/core/io/doubleparser/FastDoubleSwar has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0

With Java 21 or Java 22:
Caused by: java.lang.IncompatibleClassChangeError: class net.bytebuddy.implementation.FieldAccessor$FieldNameExtractor$ForBeanProperty$1 cannot inherit from final class net.bytebuddy.implementation.FieldAccessor$FieldNameExtractor$ForBeanProperty

Stuck !

1 Like

Let’s wait for katalon investigation and fix/workaround for this issue

1 Like

To fix this:

Java.lang.UnsupportedClassVersionError: META-INF/versions/21/com/fasterxml/jackson/core/io/doubleparser/FastDoubleSwar has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0

Steps:

  • download JDK 21
  • add it (…/…/jdk-21.x.x.jdk/Contents/Home) to Katalon Studio : Preferences → Java → Installed JREs
  • select JDK added on the list of installed JREs
  • click on Apply and Close button
2 Likes

@depapp @ffrik can you confirm?

1 Like

So Java 21 gives this :

Caused by: java.lang.IncompatibleClassChangeError: class net.bytebuddy.implementation.FieldAccessor$FieldNameExtractor$ForBeanProperty$1 cannot inherit from final class net.bytebuddy.implementation.FieldAccessor$FieldNameExtractor$ForBeanProperty

If I launch directly a feature on my side.
But It works I launch a test suite.
Maybe this can be a workaroud → launch by suite, not by feature

2 Likes

hey @dineshh

i have tried @adadiagne08 suggestion to use JDK 21, still got same issue. bytebuddy things

also i have tried @ffrik suggestion to execute test from suite, still got same issue.

for your information @kazurayam

please help to fix it ASAP katalon team (@Elly_Tran ), since it’s a blocker for me and the others

3 Likes

hey @depapp to fix this error:

java.lang.IncompatibleClassChangeError: class net.bytebuddy.implementation

you need to:

  • add CucumberGlueGenerator.addDefaultPackages() in your Test Listener (@BeforeTestSuite for example)
  • execute your test by Test Suite and not by Feature File
1 Like

@depapp Can you try above suggestion and confirm?

1 Like

@depapp How is it? i have the same problem and cant resolve it until now

1 Like

hey everyone @kazurayam @gregorio.catalan @ffrik @dineshh @adadiagne08 @claytonmildy

I found the solution for this issue.

  1. if you are using Katalon Studio v9, you need to use Java/JDK/JRE 21. you can change the configuration under Settings --> Java --> Installed JRE

  2. you should change your package from (default package) to your own, for example YourPackageName

  3. you should add the Test Listener on the project, here’s the example:

// README: the Test Listener filename should be `Listener`
// README: you should change the `YourPackageName` to your own package name

import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW

class Listener {
	/**
	 * Executes before every test case starts.
	 * @param testCaseContext related information of the executed test case.
	 */
	@BeforeTestCase
	def sampleBeforeTestCase(TestCaseContext testCaseContext) {
		CucumberKW.GLUE = ['YourPackageName']
	}
}
  1. now you should able to run your BDD test from anywhere (from Feature Files, from Test Case or from Test Suite)

I have following this official documentation, but didn’t works :-1:

if you are confuse, just ping me or you can see on the attached images

8 Likes