Run Katalon Scripts on Jenkins Get java.lang.ClassCastException


#1

Local running all good, but when integrate with Jenkins, always getting this exception.
Waiting online…
!SESSION 2019-04-27 23:11:10.510 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_45
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -runMode=console -projectPath=/home/allen/jenkins1/workspace/orm-E2E-Cases-Automation-KXVYUZU7QXAKZ2SNZTV7532QEX5NDVJRT7UMRGV2PDMU75KYCRLA/Platform/Platform.prj -retry=0 -testSuiteCollectionPath=Test Suites/Customer E2E Case/E2EQual -remoteWebDriverType=Selenium -executionProfile=default -remoteWebDriverUrl=http://10.110.110.50:4444/wd/hub -browserType=Remote --config -proxy.option=MANUAL_CONFIG -proxy.server.type=HTTP -proxy.server.address= 10.110.110.125 -proxy.server.port= 443
Command-line arguments: -os linux -ws gtk -arch x86_64 -data config -runMode=console -consoleLog -projectPath=/home/allen/jenkins1/workspace/orm_E2E-Cases-Automation-KXVYUZU7QXAKZ2SNZTV7532QEX5NDVJRT7UMRGV2PDMU75KYCRLA/Platform/Platform.prj -retry=0 -testSuiteCollectionPath=Test Suites/Customer E2E Case/E2EQual -remoteWebDriverType=Selenium -executionProfile=default -remoteWebDriverUrl=http://10.110.110.50:4444/wd/hub -browserType=Remote --config -proxy.option=MANUAL_CONFIG -proxy.server.type=HTTP -proxy.server.address= 10.110.110.125 -proxy.server.port= 443

!ENTRY org.eclipse.core.resources 2 10035 2019-04-27 23:11:13.035
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
Starting Groovy-Eclipse compiler resolver. Specified compiler level: unspecified
169 2.4.7.xx-201611170128-e46 = ACTIVE
Request sent successfully.
java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.io.ObjectStreamClass
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1512)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
at java.util.ArrayList.readObject(ArrayList.java:791)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1896)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
at com.kms.katalon.controller.ProjectController.getRecentProjects(ProjectController.java:190)
at com.kms.katalon.controller.ProjectController.addRecentProject(ProjectController.java:136)
at com.kms.katalon.controller.ProjectController.openProject(ProjectController.java:102)
at com.kms.katalon.execution.console.ConsoleMain.getProject(ConsoleMain.java:313)
at com.kms.katalon.execution.console.ConsoleMain.findProject(ConsoleMain.java:218)
at com.kms.katalon.execution.console.ConsoleMain.launch(ConsoleMain.java:121)
at com.kms.katalon.console.application.Application.runConsole(Application.java:76)
at com.kms.katalon.core.application.Application.runConsole(Application.java:80)
at com.kms.katalon.core.application.Application.start(Application.java:63)
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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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)


#2

Hi @zhuxinglun,

Please manually delete the recent_projects file in <KS installed folder>/config/recent_projects then run your command agains.

Thanks


#3

Hey Buddy,
your solution is working, so excited.
BTW, may I know the root cause, I am thinking if I need to configure the deletion operation in Jenkinsfile for each build.
Thanks a lot


#4

Hi @zhuxinglun,

It’s OK to configure Jenkins to remove that file before every run.