ClassCastException when running ALM task
Closed this issue · 2 comments
When running an ALM task we get the following error in the build log:
simple 13-May-2022 11:31:06 Starting task 'Execute tests in ALM' of type 'com.adm.app-delivery-management-bamboo:RunFromAlmLabManagementUftTask'
simple 13-May-2022 11:31:06 Start login to ALM server with APIkey...
simple 13-May-2022 11:31:06 Logged in successfully to ALM Server ***** using apikey-***
simple 13-May-2022 11:31:08 Executing TEST_SET ID: **** in ***
Description:
simple 13-May-2022 11:31:08 TEST_SET run report for run id 5027 is at: NA
simple 13-May-2022 11:31:08 Polling... Run ID: 5027
simple 13-May-2022 11:31:08 Timeslot id: 4875
simple 13-May-2022 11:31:08 2022-05-13 11:31:06:Timeslot ID '4875' was created successfully
simple 13-May-2022 11:31:08 2022-05-13 11:31:07:Creating run-time data for run '5027' of 'Test Set' '175346' (Timeslot ID '4875'; BVS ID '5340')
simple 13-May-2022 11:31:13 2022-05-13 11:31:08:TestSet ID: '5026' start time: '2022-05-13 11:31:08.349'
simple 13-May-2022 11:33:19 2022-05-13 11:33:15:Timeslot ID '4875' was closed
simple 13-May-2022 11:33:19 Timeslot 4875 is Finished.Timeslot start time: 2022-05-13 11:31:06, Timeslot end time: 2022-05-13 11:33:15
simple 13-May-2022 11:33:19 Run state of 5027: Finished, Completed successfully: N
simple 13-May-2022 11:33:19 Bamboo build timestamp variable has value: 2022-05-13T11:31:05.240+02:00
simple 13-May-2022 11:33:19 Failed to create run results, Exception: ClassCastException: attempting to cast jar:file:/C:/Program%20Files/Java/jre1.8.0_331/lib/rt.jar!/javax/xml/bind/JAXBContext.class to bundle://19.0:1/javax/xml/bind/JAXBContext.class. Please make sure that you are specifying the proper ClassLoader.
simple 13-May-2022 11:33:19 Finished task 'Execute tests in ALM' with result: Failed
It's a bit unclear how this can be mitigated, we assume a bug in parsing the result from the ALM server.
Hi Christian,
I apologize for this late reply.
Can you provide the environment details please?
Mainly, we need to know the JDK version from client / agent machine and the JDK version from Bamboo server machine.
In general, the client and server should use the same JDK version (preferably either 1.8 or 11).
The plugin is currently compiled for JDK 1.8, but if you need it compiled for JDK11 please let us know.
Thank you,
Dorin.
Hi Dorin.
We tested it with JDK 8 and JDK 11 and both had the same issue at the time.
I think to have the same JDK version on client/server is a misunderstanding of the basic concept. The bamboo server transports the JAR file as OSGI plugin as-is to the Remote Agent machine which is then loaded into OSGI. The file on the server and the client are binary identical. The file is not re-compiled anywhere. The compatibility of an addon should always be the same as the server and match the supported JDK which are described by Atlassian for a version. While loading the OSGI plugin on the agent machine the server or its JVM are not relevant.
The JVM on the agent communicates in that case with the ALM server and can't load some classes. Maybe a conflict in loading some classes.
Anyway, one of our engineers contacted you and this was solved by your engineering team just recently. So the issue is not valid for us anymore and I'll continue to close this issue.
Thanks
Christian