Basically I am trying to follow this tutorial:
https://www.youtube.com/watch?v=tqOKYDV7dj4&list=PLhW3qG5bs-L_D4ZePNNjvmIULuu6mBHbu&index=39
Here is the total configuration I followed.
- I am currently using Jenkins on a Digital Ocean Linux server (CentOS 7.0).
- Installed Katalon Studio plugins from Jenkins.
- In Jenkins added the Git repository “https://github.com/Raghav-Pal/KatalonTestsDemo.git”
- In the Build section of Jenkins, I choose “Execute Katalon Studio Tests” and added the below
a. Download Katalon Studio version: 7.0.0
b. Command arguments: "-retry=0 -testSuitePath="Test Suites/TestSuite1" -executionProfile="default" -browserType="Web Service""
Now, When I tried to build this project I am getting an error in the console output of the Jenkins.
Started by user admin
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/Katalon_automation
No credentials specified
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/Raghav-Pal/KatalonTestsDemo.git # timeout=10
Fetching upstream changes from https://github.com/Raghav-Pal/KatalonTestsDemo.git
> git --version # timeout=10
> git fetch --tags --progress -- https://github.com/Raghav-Pal/KatalonTestsDemo.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 464472c71aa92f88c29a57a354e61529ff5fcb78 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 464472c71aa92f88c29a57a354e61529ff5fcb78 # timeout=10
Commit message: "added test3"
> git rev-list --no-walk 464472c71aa92f88c29a57a354e61529ff5fcb78 # timeout=10
[2019-11-10T09:33:40.774794] Katalon Studio package has been downloaded already.
[2019-11-10T09:33:40.775052] Using Katalon Studio at /var/lib/jenkins/.katalon/7.0.0/Katalon_Studio_Engine_Linux_64-7.0.0
[2019-11-10T09:33:40.775144] Making driver executables...
[2019-11-10T09:33:40.775184] Drivers folder at: /var/lib/jenkins/.katalon/7.0.0/Katalon_Studio_Engine_Linux_64-7.0.0/configuration/resources/drivers
[2019-11-10T09:33:40.775698] Set chromedriver as executable !
[2019-11-10T09:33:40.775952] Set geckodriver as executable !
[2019-11-10T09:33:40.776834] Execute [sh, -c, /var/lib/jenkins/.katalon/7.0.0/Katalon_Studio_Engine_Linux_64-7.0.0/katalonc -noSplash -runMode=console -projectPath="/var/lib/jenkins/workspace/Katalon_automation" -retry=0 -testSuitePath="Test Suites/TestSuite1" -executionProfile="default" -browserType="Web Service" ] in /tmp/katalon-193415871343130816
[2019-11-10T09:33:44.570534] Katalonc: Cannot open display:
[2019-11-10T09:33:44.570686] Katalonc:
[2019-11-10T09:33:44.570742] An error has occurred. See the log file
[2019-11-10T09:33:44.570766] /var/lib/jenkins/.katalon/7.0.0/Katalon_Studio_Engine_Linux_64-7.0.0/configuration/1573378421474.log.
Build step 'Execute Katalon Studio Tests' marked build as failure
Finished: FAILURE
The error is
Katalonc: Cannot open display:
[2019-11-10T09:33:44.570686] Katalonc:
[2019-11-10T09:33:44.570742] An error has occurred. See the log file
[2019-11-10T09:33:44.570766] /var/lib/jenkins/.katalon/7.0.0/Katalon_Studio_Engine_Linux_64-7.0.0/configuration/1573378421474.log.
Build step 'Execute Katalon Studio Tests' marked build as failure
I am also providing the error log 1573378421474.log
from the directory
/var/lib/jenkins/.katalon/7.0.0/Katalon_Studio_Engine_Linux_64-7.0.0/configuration/
Error log from the file 1573378421474.log
!SESSION 2019-11-10 09:33:41.257 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.5
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -runMode=console -projectPath=/var/lib/jenkins/workspace/Katalon_automation -retry=0 -testSuitePath=Test Suites/TestSuite1 -executionProfile=default -browserType=Web Service
Command-line arguments: -os linux -ws gtk -arch x86_64 -data @noDefault -runMode=console -projectPath=/var/lib/jenkins/workspace/Katalon_automation -retry=0 -testSuitePath=Test Suites/TestSuite1 -executionProfile=default -browserType=Web Service
!ENTRY org.eclipse.osgi 4 0 2019-11-10 09:33:44.136
!MESSAGE An error occurred while automatically activating bundle com.kms.katalon.application (26).
!STACK 0
org.osgi.framework.BundleException: Exception in com.kms.katalon.application.KatalonApplicationActivator.start() of bundle com.kms.katalon.application.
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:795)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:724)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:932)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:309)
at org.eclipse.osgi.container.Module.doStart(Module.java:581)
at org.eclipse.osgi.container.Module.start(Module.java:449)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:470)
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:529)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:325)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:345)
at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:419)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at com.kms.katalon.core.application.Application.createLicenseFolder(Application.java:238)
at com.kms.katalon.core.application.Application.start(Application.java:52)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
Caused by: org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:386)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:294)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
at org.eclipse.e4.ui.services.events.EventBrokerFactory.compute(EventBrokerFactory.java:29)
at org.eclipse.e4.core.internal.contexts.ValueComputation.get(ValueComputation.java:62)
at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:250)
at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:216)
at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:589)
at com.kms.katalon.application.KatalonApplicationActivator.start(KatalonApplicationActivator.java:32)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:774)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:767)
... 31 more
Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:151)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:375)
... 43 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.1.v20160712-0927
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:410)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 45 more
Root exception:
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:386)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:294)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
at org.eclipse.e4.ui.services.events.EventBrokerFactory.compute(EventBrokerFactory.java:29)
at org.eclipse.e4.core.internal.contexts.ValueComputation.get(ValueComputation.java:62)
at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:250)
at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:216)
at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:589)
at com.kms.katalon.application.KatalonApplicationActivator.start(KatalonApplicationActivator.java:32)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:774)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:767)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:724)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:932)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:309)
at org.eclipse.osgi.container.Module.doStart(Module.java:581)
at org.eclipse.osgi.container.Module.start(Module.java:449)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:470)
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:529)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:325)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:345)
at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:419)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at com.kms.katalon.core.application.Application.createLicenseFolder(Application.java:238)
at com.kms.katalon.core.application.Application.start(Application.java:52)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:151)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:375)
... 43 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.1.v20160712-0927
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:410)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 45 more
!ENTRY org.eclipse.osgi 4 0 2019-11-10 09:33:44.158
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: com/kms/katalon/application/utils/ApplicationInfo
at com.kms.katalon.core.application.Application.createLicenseFolder(Application.java:238)
at com.kms.katalon.core.application.Application.start(Application.java:52)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
Caused by: java.lang.ClassNotFoundException: An error occurred while automatically activating bundle com.kms.katalon.application (26).
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:116)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:529)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:325)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:345)
at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:419)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 15 more
Caused by: org.osgi.framework.BundleException: Exception in com.kms.katalon.application.KatalonApplicationActivator.start() of bundle com.kms.katalon.application.
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:795)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:724)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:932)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:309)
at org.eclipse.osgi.container.Module.doStart(Module.java:581)
at org.eclipse.osgi.container.Module.start(Module.java:449)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:470)
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
... 24 more
Caused by: org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:386)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:294)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
at org.eclipse.e4.ui.services.events.EventBrokerFactory.compute(EventBrokerFactory.java:29)
at org.eclipse.e4.core.internal.contexts.ValueComputation.get(ValueComputation.java:62)
at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:250)
at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:216)
at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:589)
at com.kms.katalon.application.KatalonApplicationActivator.start(KatalonApplicationActivator.java:32)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:774)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:767)
... 31 more
Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:151)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:375)
... 43 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.1.v20160712-0927
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:410)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
3
Answers
The issue was
Using
java version "1.8.0_231"
nowNow katalon is launched in Linux CentOS. Though, can not run the test from command-line as Jenkins build is marked failed
So ultimately I need to purchase license for running Katalon test from command line.
I think your problem may be the browser setting. In the Katalon Documentation, the -browserType command line option specifically says, “Only Chrome, Firefox and Remote is available for use in Linux version.” but you are trying to call “Web Service”.
https://docs.katalon.com/katalon-studio/docs/console-mode-execution.html#general-options
Starting from Katalon version 7.0 you need a license to execute from command line.
Use a lower version and try it out. But you have to be careful as some imports and methods are not supported on lower versions as lower versions are deprecated and no further support available.