Resolving Java class inheritance error in Katalon version 10.0.0.223

hi guyss, i have another issue, anyone can help ?
im using katalon version : 10.0.0.223
jre : 21
i have add this in build.gradle also

dependencies {
 implementation 'net.bytebuddy:byte-buddy:1.12.8' // or the compatible version with Katalon
}

configurations.all {
    resolutionStrategy {
        force 'net.bytebuddy:byte-buddy:1.12.8'
    }
}

but got this errror

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

1 Like

Possibly the same as the following issue:

i did follow the solution, but still got the same issuee @kazurayam


but to be honest im quite confused about the package name. where i should change the package name ?

and for the listerner, i have added new listener file.

did i make a mistake ?

@Elly_Tran

Could you point @rosdiana.sitinjak to an appropriate instruction by Katalon?

thanks @kazurayam

hi @Elly_Tran could u pls help me ?
im stuck with this nettbuddy issue :frowning:

you have to add this import line @rosdiana.sitinjak

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

and for the package name, you should see on the Include/ folder

on my case, the package name is common
so your CucumberKW.GLUE = ['YourPackageName'] should be

CucumberKW.GLUE = ['common']
4 Likes

import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
i have import this in my test casee…

and the package name on my Include/ folder also common.
so where i should put this CucumberKW.GLUE = [‘common’] @depapp ?
in Include/` folder - common package ya ?

@rosdiana.sitinjak you should import this on the Test Listener file

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

you should see the CucumberKW.GLUE line looks like this if it’s imported correctly

if I see your attached image, it’s seems your import it’s not correct:

========================================================================

for your next question, this line

CucumberKW.GLUE = ['common']

should be on the Test Listener file. as you can see on the first attached image

5 Likes

okay, i have follow those step…
and the nettbuddy issue already gone. thanks @depapp @kazurayam for your help.
but currently im facing new issue :frowning:
1 Scenarios (e[33m1 undefinede[0m)
3 Steps (e[33m3 undefinede[0m)

so the gherkin step in cucumber is not recognized. when am googling about this the solution is make sure cucumber plugin is installed in katalon store, but when i go to my katalon store and search cucumber plugin, its not found…
where i can install the cucumber plugin ?

Your text in the above post looks strange. It’s diffcult to read

Please clean it.

seems like you @rosdiana.sitinjak use

   Scenario: 

==============================================

try this instead:

   Scenario Outline:

and also you should add the data tables examples

   Examples:
   | username  | password |
   | johndoe   | example  |
4 Likes

it works now by following step that you shared @depapp
thank you so much guys for your help @depapp @kazurayam

1 Like

anytime.
to make it easier for others to find the solution, I think it would be great if you @rosdiana.sitinjak could mark my answer as the solution. thanks

2 Likes

sure…
my issue solved by following this step:

  1. you need to use Java/JDK/JRE 21. you can change the configuration under Settings --> Java --> Installed JRE
  2. 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']
	}
}

notes :
YourPackageName is taken from you should see on the Include/ folder

  1. should import this on the Test Listener file
    import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW

  2. use Scenario Outline: instead Scenario in your feature file
    thankss @depapp @kazurayam for your help :pray:

anyway, you @rosdiana.sitinjak don’t need to re-explain the solution.
what I mean is just click this button on the reply
image

so the marked reply should be marked as the solution of your issue

2 Likes

hi @depapp , I still have an error even though I already implemented your method.

What I have implemented:

  1. add listener class
  2. add script package to CucumberKW.GLUE
  3. change katalon JRE config to 21
  4. using scenario outline

This is my environment:

  1. Katalon Studio Enterprise 9.7.2
  2. Appium 2.0.1
  3. Node 22.13.0
  4. JDK 21
  5. XCode 16.2
  6. MacOs

This is my Listener class

class TestListener {
	/**
	 * Executes before every test case starts.
	 * @param testCaseContext related information of the executed test case.
	 */
	@BeforeTestCase
	def sampleBeforeTestCase(TestCaseContext testCaseContext) {
		CucumberKW.GLUE = ['hybrid.login', 'hybrid.info']
		  /**code**/
	}
 
	/**
	 * Executes after every test case ends.
	 * @param testCaseContext related information of the executed test case.
	 */
	@AfterTestCase
	def sampleAfterTestCase(TestCaseContext testCaseContext) {
            /**code**/
	}
}

this is my script package structure:


[

this is my test case class:

@RunWith(Cucumber.class)
@CucumberOptions(features = ".../MyFeature.feature", glue='', tags = "@MyFeature")
protected class Runner {}
 
CucumberKW.runWithCucumberRunner(Runner.class, FailureHandling.STOP_ON_FAILURE)

This is my feature file:

This is my error:

Keyword runWithCucumberRunner was failed (Root cause: com.kms.katalon.core.exception.StepFailedException: These following reason:
[class net.bytebuddy.implementation.FieldAccessor$FieldNameExtractor$ForBeanProperty$1 cannot inherit from final class net.bytebuddy.implementation.FieldAccessor$FieldNameExtractor$ForBeanProperty]

Can you spot where’s wrong with my work? Thanks

Hey @galihindra2401,

How about using CucumberKW.runFeatureFileWithTags() instead of CucumberKW.runWithCucumberRunner()?
Does it work and meet your requirements?

Actually, I have a boilerplate project for Katalon BDD: GitHub - depapp/sample-bdd-project-in-katalon-latest-version: This project is a boilerplate setup for Behavior-Driven Development (BDD) testing in Katalon Studio, compatible with both versions 9 and 10. It provides a structured template designed to streamline the development and execution of BDD tests using Gherkin syntax..
Maybe you can try running the project on your machine so we can isolate where the issue is—whether it’s in the configuration itself or the project.

1 Like