Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

ItemNotFoundException when trying to compute a file path (the request item is absent from configuration)

 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);
try {
 while (filePathHandle != null) {
   final String name = currentItem.getName();
   if (name != null & name.length() > 0) {
     filePath = name + File.separator + filePath;
   }
   filePathHandle = currentItem.getParent();
   if (filePathHandle != null) {
     //You have to switch from verManager.fetchCompleteState(versionableHandle, monitor) to
     // iconfig.fetchCompleteItem (versionableHandle, monitor) to avoid null state for folders.
      log.debug("To get the filePath for File:" + currentItem.getName() + " FilePath: " + filePath);
     currentItem = iConfig.fetchCompleteItem(filePathHandle, monitor);
   }
 }
 if (!filePath.isEmpty() && (versionableHandle instanceof IFileItemHandle)) {
   workingFileName = filePath.substring(0, filePath.length() - 1);
 }
I have seen mutliple links to fetch the full file path :






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);

</pre>

and then I am get the IConfig Object like this :
IConfiguration iConfig = workspaceConnection.configuration(componentHandle);

    </pre>
    <pre style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Menlo; font-size: 9pt;">

I can even get the fileName using : IVersionable.getName() .. but problem is while retrieving full file path.

    </pre>
    <pre style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Menlo; font-size: 9pt;">

Any use-case when this fileItem won't be present in IConfig ?

    </pre>
    <pre style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Menlo; font-size: 9pt;">

Because as per my understanding if this changeset is present in workSpace means it should be present in IConfig as well ?

    </pre>
</div>



2

0 votes

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?



One answer

Permanent link

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.

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937
× 169

Question asked: Jan 31 '18, 5:39 a.m.

Question was seen: 3,549 times

Last updated: Jun 04 '18, 10:57 a.m.

Confirmation Cancel Confirm