java.lang.NoClassDefFoundError: Could not initialize class com.kms.katalon.core.webui.keyword.builti


#1

I ma trying to Run Katalon on console mode on my server for CI/CD integration

Whenever i run my tests, i get the following error:

12-18-2017 09:33:12 AM - [START] - Start action : openBrowser

12-18-2017 09:33:12 AM - [END] - End action : openBrowser

12-18-2017 09:33:12 AM - [ERROR] - Test Cases/Login FAILED because (of) java.awt.HeadlessException

12-18-2017 09:33:12 AM - [END] - End Test Case : Test Cases/Login

12-18-2017 09:33:12 AM - [START] - Start Test Case : Test Cases/CA

12-18-2017 09:33:12 AM - [INFO] - Evaluating variables for test case

12-18-2017 09:33:12 AM - [START] - Start action : openBrowser

12-18-2017 09:33:12 AM - [END] - End action : openBrowser

12-18-2017 09:33:12 AM - [ERROR] - Test Cases/CA FAILED because (of) java.lang.NoClassDefFoundError: Could not initialize class com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword

12-18-2017 09:33:12 AM - [END] - End Test Case : Test Cases/CA

the same test runs fine on Windows using GUI but failed on Server.
Not sure if i am missing any dependency


#2

Issue resolved.

Was using OpenJDK before but you need to use Oracle JDK only.


#3

Hi, I am stuck with this issue. could anyone have best solution to handle this, please?Error

java.lang.NoClassDefFoundError: Could not initialize class com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword

We are trying to run on Ubuntu OS.


#4

Hii… it also happen to me using Katalon_Studio_Linux_64-5.3.0 on Ubuntu 16.04.3 LTS , previously it works on Katalon_Studio_Linux_64-5.1

02-14-2018 11:20:47 AM - [ERROR]  - Test Cases/testCase_headless FAILED because (of) java.lang.NoClassDefFoundError: Could not initialize class com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword

here the detail log :
https://pastebin.com/raw/4rjAYweW

Java_home already set to OracleJDK


#5

Ah sorry, i’m forget to update the fix.

in my case every time i run katalon inside ubuntu servir it always return java.lang.NoClassDefFoundError: com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword

The solution is quite simple, just add xvfb befor katalon execution

xvfb-run -a ./katalon --args -runMode=console -projectPath="yourworkspace/theproject.prj" -retry=0 -testSuiteCollectionPath="Test Suites/SanityTest User Account"

#6

Hari said:

Hi, I am stuck with this issue. could anyone have best solution to handle this, please?Error

java.lang.NoClassDefFoundError: Could not initialize class com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword

We are trying to run on Ubuntu OS.

Hi Hari, did you solved the above issue, i’m also facing exactly the same. Thanks


#7

Thank you for the report. We have identified the root cause and will have a fix soon.


#8

katalon studio works under CentOS7/Redhad ?

  • i download the katalon studio for linux .
  • i installed the OpenJdk8 not worked ! through gitlab ci pipeline
  • i replaced the openJdk by the oracle jdk also not worked !
    ps:same project tested on win server & win 10 worked well

#9

hi @ahmd.belhoula,

What is the error, can you provide us more details?


#10

hi @duyluong,

here is the log

`--------------------------------------------------------------------------------
Test Suites/Test suite Login - Remote - http://10.12.1.10:9000 - 20190117_171415
…0/1(0%)

Request sent successfully.
2019-01-17 17:14:20.410 INFO c.k.katalon.core.main.TestSuiteExecutor - START Test Suites/Test suite Login
2019-01-17 17:14:20.450 INFO c.k.katalon.core.main.TestSuiteExecutor - hostName = root - tools-jks-cen02.onl.myopenbee.com
2019-01-17 17:14:20.452 INFO c.k.katalon.core.main.TestSuiteExecutor - os = Linux 64bit
2019-01-17 17:14:20.452 INFO c.k.katalon.core.main.TestSuiteExecutor - hostAddress = 10.12.1.20
2019-01-17 17:14:20.453 INFO c.k.katalon.core.main.TestSuiteExecutor - katalonVersion = 5.10.1.1
2019-01-17 17:14:20.728 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2019-01-17 17:14:20.728 INFO c.k.katalon.core.main.TestCaseExecutor - START Test Cases/Login Page/Login
2019-01-17 17:14:20.779 INFO c.k.katalon.core.main.TestCaseExecutor - (Default) username =
2019-01-17 17:14:20.787 INFO c.k.katalon.core.main.TestCaseExecutor - (Default) password =
2019-01-17 17:14:21.048 ERROR c.k.k.core.context.internal.TestHooker - :x: org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.ExceptionInInitializerError
2019-01-17 17:14:21.181 DEBUG testcase.Login - 1: setText(findTestObject(“Object Repository/login/Page_Login/login”), username)
2019-01-17 17:14:21.213 ERROR c.k.katalon.core.main.TestCaseExecutor - :x: setText(findTestObject(“Object Repository/login/Page_Login/login”), username) FAILED.
Reason:
java.lang.NoClassDefFoundError: com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword
at com.kms.katalon.core.keyword.internal.KeywordExecutor.getActions(KeywordExecutor.groovy:130)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:49)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.setText(WebUiBuiltInKeywords.groovy:950)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$setText$0.call(Unknown Source)
at Login.run(Login:20)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:319)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:298)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:290)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:224)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:129)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:112)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:81)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:149)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1547741655465.run(TempTestSuite1547741655465.groovy:36)

2019-01-17 17:14:21.215 ERROR c.k.katalon.core.main.TestCaseExecutor - :x: Test Cases/Login Page/Login FAILED.
Reason:
java.lang.NoClassDefFoundError: com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword
at com.kms.katalon.core.keyword.internal.KeywordExecutor.getActions(KeywordExecutor.groovy:130)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:49)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.setText(WebUiBuiltInKeywords.groovy:950)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$setText$0.call(Unknown Source)
at Login.run(Login:20)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:319)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:298)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:290)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:224)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:129)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:112)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:81)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:149)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1547741655465.run(TempTestSuite1547741655465.groovy:36)

2019-01-17 17:14:21.222 ERROR c.k.k.core.context.internal.TestHooker - :x: org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword
2019-01-17 17:14:21.223 INFO c.k.katalon.core.main.TestCaseExecutor - END Test Cases/Login Page/Login
2019-01-17 17:14:21.249 INFO c.k.katalon.core.main.TestSuiteExecutor - --------------------
2019-01-17 17:14:21.249 INFO c.k.katalon.core.main.TestSuiteExecutor - END Test Suites/Test suite Login
2019-01-17 17:14:21.249 INFO c.k.katalon.core.main.TestSuiteExecutor - ====================
Uploading report to Katalon Analytics…
Start sending test result to Katalon Analytics
Uploading log files in folder path: /home/gitlab-runner/builds/xyywL9gj/0/ahmed_b/qa-ccfn/Reports/Test suite Login/20190117_171415
Sending file: /home/gitlab-runner/builds/xyywL9gj/0/ahmed_b/qa-ccfn/Reports/Test suite Login/20190117_171415/execution0.log
Sending file: /home/gitlab-runner/builds/xyywL9gj/0/ahmed_b/qa-ccfn/Reports/Test suite Login/20190117_171415/execution.properties
Sending file: /home/gitlab-runner/builds/xyywL9gj/0/ahmed_b/qa-ccfn/Reports/Test suite Login/20190117_171415/JUnit_Report.xml
Sending file: /home/gitlab-runner/builds/xyywL9gj/0/ahmed_b/qa-ccfn/Reports/Test suite Login/20190117_171415/execution.uuid
End sending to Katalon Analytics
Report has been sent to Katalon Analytics


Test Suites/Test suite Login - Remote - http://10.12.1.10:9000 - 20190117_171415
…1/1(100%)

ERROR: Job failed: exit status 1`


#11

Hi @ahmd.belhoula,

You need to install xvfb in the linux machine.
Please read this post: How to use Katalon plugin for Jenkins on Ubuntu.


#12

hi @duyluong ,
this does not meet my need because i want to run tests under IE 11, otherwise ,it is possible to run tests in remote mode which means in my case :thinking: i have katalon under a linux machine and IEdriver a windows machine.

thanks
:slight_smile:


#13

Hi @ahmd.belhoula,

Currently, Katalon Studio doesn’t provide that. Btw, you can create a test suite collection to run in windows and others in linux.