运行 来自 Jenkins 的 Katalon Studio 构建失败
Build failed while running Katalon Studio from Jenkins
基本上我正在尝试按照本教程进行操作:
https://www.youtube.com/watch?v=tqOKYDV7dj4&list=PLhW3qG5bs-L_D4ZePNNjvmIULuu6mBHbu&index=39
这是我遵循的总配置。
- 我目前在 Digital Ocean Linux 服务器 (CentOS 7.0) 上使用 Jenkins。
- 从 Jenkins 安装了 Katalon Studio 插件。
- 在 Jenkins 中添加了 Git 存储库“https://github.com/Raghav-Pal/KatalonTestsDemo.git”
- 在 Jenkins 的构建部分,我选择 "Execute Katalon Studio Tests" 并添加以下内容
一个。下载 Katalon Studio 版本:7.0.0
b。命令参数:"-retry=0 -testSuitePath="Test Suites/TestSuite1" -executionProfile="default" -browserType="Web Service""
现在,当我尝试构建这个项目时,我在 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
错误是
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
我还提供目录
中的错误日志 1573378421474.log
/var/lib/jenkins/.katalon/7.0.0/Katalon_Studio_Engine_Linux_64-7.0.0/configuration/
来自文件 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.run(BundleContextImpl.java:774)
at org.eclipse.osgi.internal.framework.BundleContextImpl.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.run(BundleContextImpl.java:774)
at org.eclipse.osgi.internal.framework.BundleContextImpl.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.run(BundleContextImpl.java:774)
at org.eclipse.osgi.internal.framework.BundleContextImpl.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)
我想你的问题可能是浏览器设置问题。在 Katalon 文档中,-browserType 命令行选项特别指出,"Only Chrome, Firefox and Remote is available for use in Linux version." 但您正在尝试调用 "Web Service"。
https://docs.katalon.com/katalon-studio/docs/console-mode-execution.html#general-options
问题是
java.version=11.0.5
现在正在使用 java version "1.8.0_231"
现在 katalon 在 Linux CentOS 中启动。
但是,不能 运行 从命令行进行测试,因为 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-13T16:16:20.361] Katalon Studio package has been downloaded already.
[2019-11-13T16:16:20.361] Using Katalon Studio at /var/lib/jenkins/.katalon/7.0.0/Katalon_Studio_Engine_Linux_64-7.0.0
[2019-11-13T16:16:20.361] Making driver executables...
[2019-11-13T16:16:20.361] Drivers folder at: /var/lib/jenkins/.katalon/7.0.0/Katalon_Studio_Engine_Linux_64-7.0.0/configuration/resources/drivers
[2019-11-13T16:16:20.362] Set chromedriver as executable !
[2019-11-13T16:16:20.363] Set geckodriver as executable !
[2019-11-13T16:16:20.364] 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="/var/lib/jenkins/workspace/Katalon_automation/Test\ Suites/TestSuite1" -executionProfile="default" -browserType="Web Service" ] in /tmp/katalon-1472224603496043268
[2019-11-13T16:16:23.723] Katalon workspace folder is set to default location: /var/lib/jenkins/.katalon/7.0.0/Katalon_Studio_Engine_Linux_64-7.0.0/config
[2019-11-13T16:16:24.061] Starting Groovy-Eclipse compiler resolver. Specified compiler level: unspecified
[2019-11-13T16:16:24.065] 171 2.4.7.xx-201611170128-e46 = ACTIVE
[2019-11-13T16:16:24.455]
[2019-11-13T16:16:24.455]
[2019-11-13T16:16:24.458] INFO: Katalon Version: 7.0.0
[2019-11-13T16:16:24.461] INFO: Command-line arguments: -runMode=console -projectPath=/var/lib/jenkins/workspace/Katalon_automation -retry=0 -testSuitePath=/var/lib/jenkins/workspace/Katalon_automation/Test\ Suites/TestSuite1 -executionProfile=default -browserType=Web Service
[2019-11-13T16:16:24.467] INFO: User working dir: /tmp/katalon-1472224603496043268
[2019-11-13T16:16:24.469] INFO: TestOps server URL: https://analytics.katalon.com
[2019-11-13T16:16:24.472] INFO: Katalon Store server URL: https://store.katalon.com
[2019-11-13T16:16:24.473] INFO: User home: /var/lib/jenkins
[2019-11-13T16:16:24.474] INFO: Java vendor: Oracle Corporation
[2019-11-13T16:16:24.476] INFO: Java version: 1.8.0_231
[2019-11-13T16:16:24.476] INFO: Local OS: Linux 64bit
[2019-11-13T16:16:24.611] INFO: CPU load: 0%
[2019-11-13T16:16:24.620] INFO: Total memory: 15884 MB
[2019-11-13T16:16:24.621] INFO: Free memory: 4689 MB
[2019-11-13T16:16:24.650] INFO: Machine ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[2019-11-13T16:16:24.650]
[2019-11-13T16:16:24.650]
[2019-11-13T16:16:24.653] Activating...
[2019-11-13T16:16:24.658] Start activating offline...
[2019-11-13T16:16:24.658] Finding valid offline licenses in folder: /var/lib/jenkins/.katalon/license
[2019-11-13T16:16:24.916] The number of valid offline licenses: 0
[2019-11-13T16:16:24.916] The number of Runtime Engine running sessions: 2
[2019-11-13T16:16:24.916] License quota exceeded
[2019-11-13T16:16:24.917] Offline activation failed.
[2019-11-13T16:16:24.917] Start activating online...
[2019-11-13T16:16:24.926] Online activation for console mode failed.
[2019-11-13T16:16:24.926] Activation failed. Please make sure you are using a valid license.
Build step 'Execute Katalon Studio Tests' marked build as failure
Finished: FAILURE
所以最终我需要从命令行购买 运行ning Katalon 测试的许可证。
从 Katalon 7.0 版开始,您需要许可证才能从命令行执行。
使用较低版本并尝试一下。但是您必须小心,因为低版本不支持某些导入和方法,因为低版本已被弃用并且没有进一步的支持。
基本上我正在尝试按照本教程进行操作: https://www.youtube.com/watch?v=tqOKYDV7dj4&list=PLhW3qG5bs-L_D4ZePNNjvmIULuu6mBHbu&index=39
这是我遵循的总配置。
- 我目前在 Digital Ocean Linux 服务器 (CentOS 7.0) 上使用 Jenkins。
- 从 Jenkins 安装了 Katalon Studio 插件。
- 在 Jenkins 中添加了 Git 存储库“https://github.com/Raghav-Pal/KatalonTestsDemo.git”
- 在 Jenkins 的构建部分,我选择 "Execute Katalon Studio Tests" 并添加以下内容
一个。下载 Katalon Studio 版本:7.0.0
b。命令参数:"-retry=0 -testSuitePath="Test Suites/TestSuite1" -executionProfile="default" -browserType="Web Service""
现在,当我尝试构建这个项目时,我在 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
错误是
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
我还提供目录
中的错误日志1573378421474.log
/var/lib/jenkins/.katalon/7.0.0/Katalon_Studio_Engine_Linux_64-7.0.0/configuration/
来自文件 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.run(BundleContextImpl.java:774)
at org.eclipse.osgi.internal.framework.BundleContextImpl.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.run(BundleContextImpl.java:774)
at org.eclipse.osgi.internal.framework.BundleContextImpl.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.run(BundleContextImpl.java:774)
at org.eclipse.osgi.internal.framework.BundleContextImpl.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)
我想你的问题可能是浏览器设置问题。在 Katalon 文档中,-browserType 命令行选项特别指出,"Only Chrome, Firefox and Remote is available for use in Linux version." 但您正在尝试调用 "Web Service"。
https://docs.katalon.com/katalon-studio/docs/console-mode-execution.html#general-options
问题是
java.version=11.0.5
现在正在使用 java version "1.8.0_231"
现在 katalon 在 Linux CentOS 中启动。 但是,不能 运行 从命令行进行测试,因为 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-13T16:16:20.361] Katalon Studio package has been downloaded already.
[2019-11-13T16:16:20.361] Using Katalon Studio at /var/lib/jenkins/.katalon/7.0.0/Katalon_Studio_Engine_Linux_64-7.0.0
[2019-11-13T16:16:20.361] Making driver executables...
[2019-11-13T16:16:20.361] Drivers folder at: /var/lib/jenkins/.katalon/7.0.0/Katalon_Studio_Engine_Linux_64-7.0.0/configuration/resources/drivers
[2019-11-13T16:16:20.362] Set chromedriver as executable !
[2019-11-13T16:16:20.363] Set geckodriver as executable !
[2019-11-13T16:16:20.364] 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="/var/lib/jenkins/workspace/Katalon_automation/Test\ Suites/TestSuite1" -executionProfile="default" -browserType="Web Service" ] in /tmp/katalon-1472224603496043268
[2019-11-13T16:16:23.723] Katalon workspace folder is set to default location: /var/lib/jenkins/.katalon/7.0.0/Katalon_Studio_Engine_Linux_64-7.0.0/config
[2019-11-13T16:16:24.061] Starting Groovy-Eclipse compiler resolver. Specified compiler level: unspecified
[2019-11-13T16:16:24.065] 171 2.4.7.xx-201611170128-e46 = ACTIVE
[2019-11-13T16:16:24.455]
[2019-11-13T16:16:24.455]
[2019-11-13T16:16:24.458] INFO: Katalon Version: 7.0.0
[2019-11-13T16:16:24.461] INFO: Command-line arguments: -runMode=console -projectPath=/var/lib/jenkins/workspace/Katalon_automation -retry=0 -testSuitePath=/var/lib/jenkins/workspace/Katalon_automation/Test\ Suites/TestSuite1 -executionProfile=default -browserType=Web Service
[2019-11-13T16:16:24.467] INFO: User working dir: /tmp/katalon-1472224603496043268
[2019-11-13T16:16:24.469] INFO: TestOps server URL: https://analytics.katalon.com
[2019-11-13T16:16:24.472] INFO: Katalon Store server URL: https://store.katalon.com
[2019-11-13T16:16:24.473] INFO: User home: /var/lib/jenkins
[2019-11-13T16:16:24.474] INFO: Java vendor: Oracle Corporation
[2019-11-13T16:16:24.476] INFO: Java version: 1.8.0_231
[2019-11-13T16:16:24.476] INFO: Local OS: Linux 64bit
[2019-11-13T16:16:24.611] INFO: CPU load: 0%
[2019-11-13T16:16:24.620] INFO: Total memory: 15884 MB
[2019-11-13T16:16:24.621] INFO: Free memory: 4689 MB
[2019-11-13T16:16:24.650] INFO: Machine ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[2019-11-13T16:16:24.650]
[2019-11-13T16:16:24.650]
[2019-11-13T16:16:24.653] Activating...
[2019-11-13T16:16:24.658] Start activating offline...
[2019-11-13T16:16:24.658] Finding valid offline licenses in folder: /var/lib/jenkins/.katalon/license
[2019-11-13T16:16:24.916] The number of valid offline licenses: 0
[2019-11-13T16:16:24.916] The number of Runtime Engine running sessions: 2
[2019-11-13T16:16:24.916] License quota exceeded
[2019-11-13T16:16:24.917] Offline activation failed.
[2019-11-13T16:16:24.917] Start activating online...
[2019-11-13T16:16:24.926] Online activation for console mode failed.
[2019-11-13T16:16:24.926] Activation failed. Please make sure you are using a valid license.
Build step 'Execute Katalon Studio Tests' marked build as failure
Finished: FAILURE
所以最终我需要从命令行购买 运行ning Katalon 测试的许可证。
从 Katalon 7.0 版开始,您需要许可证才能从命令行执行。 使用较低版本并尝试一下。但是您必须小心,因为低版本不支持某些导入和方法,因为低版本已被弃用并且没有进一步的支持。