Getting ClassCastException randomly when calling IItemManager.fetchPartialItem(Location location, int flags, Collection requiredProperties, IProgressMonitor monitor)
Hello,
I am facing the following exception
when I call IItemManager.fetchPartialItem(Location location, int flags, Collection requiredProperties, IProgressMonitor monitor) with inputs
This issue happens randomly with the same input.
|
Accepted answer
David Lafreniere (4.8k●7)
| answered Jun 04 '21, 12:40 p.m.
FORUM MODERATOR / JAZZ DEVELOPER edited Jun 04 '21, 12:41 p.m. Thank you for raising this issue.
I looked into the code base and confirmed there is indeed a defect when calling the .fetch*() methods that take a Location instead of an IItemHandle. This defect would manifest when the backed item is an ISimpleItem instead of an IAuditableHandle (which is the case for snapshots [which are IBaselineSets]).
This defect can be tracked here: ClassCastException calling IItemManager.fetchPartialItem(Location...) (536375)
As a workaround, if you could parse the URL to pull out the itemId of the snapshot and build up a IBaselineSetHandle.
Then you can use IItemManager.fetchCompleteItem(IItemHandle itemHandle, int flags, IProgressMonitor monitor) to avoid this ClassCastException. Rosa Naranjo selected this answer as the correct answer
Comments
Thanks
Buu Huynh
commented Jun 07 '21, 10:22 p.m.
Thank David! I have another a workaround, if you face the ClassCastException, catch that exception and call the .fetch*() method again, it will run well.
|
2 other answers
Ralph Schoon (63.1k●3●36●46)
| answered Apr 14 '21, 4:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER I would suggest to open a case with support. |
Hello
When opening a case with support that involves API, please keep in mind this technote:
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.