ItemNotFoundException when trying to compute a file path (the request item is absent from configuration)
Shiva Tiwari (17●1●7)
| asked Jan 31 '18, 5:39 a.m.
edited Jun 04 '18, 10:57 a.m. by David Lafreniere (4.8k●7) Hi I am using RTC Enterprise version 6.0.4 . I am trying to fetch full file paths of all the files in a changeset in this way : IVersionableHandle filePathHandle = versionableHandle; currentItem = versionableManager.fetchCompleteState(versionableHandle, monitor);
I have seen mutliple links to fetch the full file path :
https://www.ibm.com/developerworks/community/blogs/7685ca43-63d4-4946-89fd-58d379a896d1/entry/how_to_read_and_write_a_file_in_the_repository_directly_without_having_to_create_a_workspace?lang=en
https://jazz.net/forum/questions/176134/how-to-get-full-path-from-changeset-for-files-that-were-added-and-deleted
My code works well with file paths. I can retrieve file paths even in case of Rename/Move/ADD/DELETE. But for some of the fileItems I am getting this error:
com.ibm.team.repository.common.ItemNotFoundException: The request item is absent from configuration
at com.ibm.team.scm.client.internal.ConnectionBasedClientConfigurationProxy.fetch(ConnectionBasedClientConfigurationProxy.java:401)
at com.ibm.team.scm.client.internal.ConnectionBasedClientConfigurationProxy.fetchCompleteItem(ConnectionBasedClientConfigurationProxy.java:591)
I am not sure what is causing this .
I am retrieving IConfiguration object like this:
IComponentHandle componentHandle = changeset.getComponent(); IConfiguration iConfig = workspaceConnection.configuration(componentHandle);
Can you please point me out why for some of the filePaths I am getting temNotFoundException.
OR if there is any alternate solution to get the full file path if I don't use the IConfiguration iConfig object?
First I am fetching the WorkSpaceConnection which contains this changeset:
workspaceManager.findWorkspacesContainingChangeset(changeSet, wsc, Integer.MAX_VALUE, monitor);
and then I am get the IConfig Object like this :
IConfiguration iConfig = workspaceConnection.configuration(componentHandle); |
One answer
I think this happens for files/folders that are deleted. It is true that the files (versionables) exist in a previous change set in history, but if the file itself, and all it's parent folders have been deleted, then in the 'current' configuration of the workspace the file and the parent folder will not exist, and thus there is no valid/known path for that versionable in the workspace you are using.
|
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.
Comments
The error message indicates that the item you are trying to get the path for IS NOT IN THE SELECTED CONFIGURATION. For whatever reason, that version of the item is not part of the component, its history/this baseline, its history. At least that is what I would think the error means. So if you can't even get the item, you can not expect to get its file path.
I updated my question. I am trying to figure out when this can happen?