Hello guys. I am facing a new challenge when working with Katalon. I am fairly new to this software and I inherited some code I have to maintain. This code worked fine until suddenly it stopped working and generated this message:
=============== ROOT CAUSE =====================
Caused by: java.lang.ClassFormatError: Illegal method name “sitecore.ConnectToAPI.Authenticate_sitecore” in class CustomKeywords
The executed tests are written in Cucumber. There are some custom Keywords which are used in the tests. One of them is method called Authenticate_sitecore() which looks like this:
Installed OpenJdk amazon-corretto-188.8.131.52.1-windows-x64, issue still persists but only under very specific circumstances - after I switch between git branches, I keep receiving that error, and nothing helps - restarting Katalon Studio, deleting bin and Lib folders, etc.
What fixes the issue is rebooting the whole system and running the project again. Any ideas why that might happen?
I will try with OpenJdk 8. But I am wondering, why this should even be an issue? Especially, since I use JRE installed with Katalon:
That is not helpful at all. Of course, 19>8 should mean it is better. And if it is not, Katalon Studio should return descriptive, easily understood exception message explaining what went wrong, instead of the user having to do the guesswork.
Also, as above, I work on Windows, so even according to official docs, global installation of JDK should not matter.
There is a subfoler named .cache in the project folder. In the .cache folder saved the compiled binaries of CustomKeywords, which will be re-used to skip compilation for quicker run.
Please try, in the git branch where you got the issue, remove the .cache folder + close the project + rerun. What does happen?
If removing the .cache folder fixes (I hope so), it suggests that the binary class file in the .cache was broken.
I do not know the reason why it was broken, and you do not need to find why. Anything breaks. I am afraid that Katalon Studio is implemented a bit buggy; it sometimes, though rarely, stores a broken binary into the .cache. All you can do is to remove the broken one and regenerate it cleanly.
I guess you have the .cache/ folder commited in your Git repository already. You must remove it out of the repository. And you want to change the .gitignore file so that it exclude the .cache/ folder. The .cache folder should never be committed into a git repository.
I think, the version of JRE has nothing to do with his case.
I am tired of this topic. Katalon runtime needs openjdk8 at system level.
In windows environment that should be provided, indeed.
However you are playing with the JRE at compile the test time.
have fun with it and figure it out what is corrupted.