It's all about the answers!

Ask a question

[closed] Error while getting Unresolved Items using RTC API


Suresh P (1166) | asked Nov 29 '13, 1:13 a.m.
closed Oct 11 '17, 10:21 a.m. by Ralph Schoon (55.4k23642)
 

Hi,

I am using RTC Client 3.0.1 Java Client APIs to get the list of Unresolved items in Pending Changes view.

I have given below the complete code snippet to get the Unresolved items.

When the local workspace specified in PathLoaction is not open in Eclipse, this piece of code is returning the list of Unresolved items.

But  when the local workspace specified in PathLocation is open in Eclipse instance, I am getting the error "com.ibm.team.filesystem.client.CopyFileAreaLockedByOtherProcess" in lcm.refreshChanges() method (error stacktrace given below for reference).

Can you help me to resolve this error.

Code snippet to get Unresolved Items:

ITeamRepository repo = TeamPlatform.getTeamRepositoryService().getTeamRepository(repoUri);

IWorkspaceManager workspaceManager = (IWorkspaceManager) repo.getClientLibrary(IWorkspaceManager.class);

IWorkspaceSearchCriteria criteria = IWorkspaceSearchCriteria.FACTORY.newInstance();

criteria.setKind(IWorkspaceSearchCriteria.WORKSPACES);

criteria.setExactName("WorskspaceTest");

List<IWorkspaceHandle> workspaceHandles = workspaceManager.findWorkspaces(criteria, Integer.MAX_VALUE, monitor);

IWorkspaceHandle wh = workspaceHandles.get(0);

FileSystemCore.startUp();

IWorkspaceConnection wc = workspaceManager.getWorkspaceConnection(wh, monitor);

ISharingManager sm = FileSystemCore.getSharingManager();

ILocalChangeManager lcm = sm.getLocalChangeManager();

String target = "Project1";

PathLocation pathlocation = new PathLocation("D:\\Suresh\\runtime-EclipseApplication");

ILocation sandBoxLocation = pathlocation.getCanonicalForm();

String[] targetPaths = target.split("/");

ISandbox sbox = sm.getSandbox(sandBoxLocation, false);

IRelativeLocation relativeLocation = new RelativeLocation(

Arrays.asList(targetPaths));

IShareable shareable = sbox.findShareable(relativeLocation, ResourceType.FOLDER);

lcm.refreshChanges(new ISandbox[] { sbox },RefreshType.TRAVERSE_ALL_WITH_RECOMPUTE_OF_KNOWN, null);

ILocalChange[] localChanges1 = lcm.getPendingChanges(new IShareable[] { shareable }, null);

for (int i = 0; i < localChanges1.length; i++) {

System.out.println(localChanges1[i].getPath());

}

 

Error Occurred in lcm.refreshChanges() method. Error Stack trace is given below:

Exception in thread "main" com.ibm.team.filesystem.client.CopyFileAreaLockedByOtherProcess: Status INFO: com.ibm.team.filesystem.client code=0 Unable to lock file D:\Suresh\Projects\Codenizant\ImpactAnalysis\runtime-EclipseApplication\.jazz5\.jazzlock null
 at com.ibm.team.filesystem.client.internal.core.SharingMetadata2.ensureExclusiveCFAAccess(SharingMetadata2.java:3074)
 at com.ibm.team.filesystem.client.internal.core.SharingMetadata2.<init>(SharingMetadata2.java:1636)
........

 at com.ibm.team.filesystem.client.internal.SharingManager.allShares(SharingManager.java:224)
 at com.ibm.team.filesystem.client.internal.Sandbox.allShares(Sandbox.java:60)
 at com.ibm.team.filesystem.client.internal.localchanges.LocalChangeManager.refreshChanges(LocalChangeManager.java:1777)
 at com.cognizant.rtc.test.RTCUtility.main(RTCUtility.java:174)

 

Thanks

Suresh


Comments
Ralph Schoon commented Nov 29 '13, 3:59 a.m. | edited Dec 04 '13, 4:07 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

This is just a guess, but I would assume that this error is due to the fact that some other SCM process is looking at the same sandbox.

The question has been closed for the following reason: "Problem is not reproducible or outdated" by rschoon Oct 11 '17, 10:21 a.m.