It's all about the answers!

Ask a question

Changes in plain API between 3.0.1 and 4.0


0
1
Michele Pegoraro (1.8k14119103) | asked Sep 11 '12, 11:39 a.m.
 Hi,
I've a code that perform check-in operation using plain API. This work correctly both on RTC 2.0.0.x and RTC 3.0.1.x.

I'm working on a migration to version 4.0 and everything seems good (no change of methods or error in compilation) but when I try to run the code I've this exception:

Exception in thread "main" TeamRepositoryException Unable to check in /TestProject/src/it/nexen/test/HelloWorld.java. Unable to resolve the repository connection for workspace load_rw com.ibm.team.filesystem.client.FileSystemException: Unable to check in /TestProject/src/it/nexen/test/HelloWorld.java. Unable to resolve the repository connection for workspace load_rw
at com.ibm.team.filesystem.client.internal.checkin.NewCheckInOperation.requestCheckin(NewCheckInOperation.java:428)
at it.nexen.rtc.task.Versioning.CheckIn(Versioning.java:351)
at it.nexen.rtc.task.Versioning.execute(Versioning.java:200)
at it.nexen.rtc.task.test.VersioningTest.main(VersioningTest.java:26)

at it.nexen.rtc.task.Versioning.execute(Versioning.java:202)
at it.nexen.rtc.task.test.VersioningTest.main(VersioningTest.java:26)

My piece of code is:

ICheckinOperation cio = IOperationFactory.instance.getCheckinOperation(CommitDilemmaHandler.getDefault(),IRepositoryResolver.EXISTING_SHARED);
String csComment = (buildAttribute==null) ? "CHECK-IN COMPILAZIONE" : buildAttribute;
IChangeSetHandle csh = iwc.createChangeSet(component, csComment, true, null);
cio.requestCheckin(shareableList , csh, "Compilazione relativa alla UDC " + ID, null);

shareable list is obtained using ILocalChangeManager.getPendingChanges method.

Does anyone knows what has been changed in ICheckinOperation?

Thanks,
Michele.

Comments
Michele Pegoraro commented Sep 11 '12, 12:51 p.m. | edited Dec 07 '12, 10:25 a.m.
 I was searching in the source code and what I've found does not make any sense...

In NewCheckInOperation:428 (suggested by exception) i find this line:

repository = resolver.getRepoFor(null, desc.getSharingDescriptor().getRepositoryId());

in IRepositoryResolver i find that the null object is a String uri. And then it calls

RepositoryUtils.getTeamRepository(id, uri, ITeamRepositoryService.EXISTING_SHARED);

in RepositoryUtils i got this (where repositoryURI is that uri called in the line before):
if (repositoryURI == null || repositoryURI.length() == 0) {
    throw new TeamRepositoryException(Messages.RepositoryUtils_0);
}

That repositoryURI cannot be different from null... or I'm missing something?

Any help would be appreciate.
Thanks,
Michele.

Michele Pegoraro commented Dec 05 '12, 6:46 a.m. | edited Dec 07 '12, 10:26 a.m.

Any help on this? If I can no more use ICheckinOperation what can be used?

This stops me from migrating from version 3.0.1 to version 4.

Thanks,
Michele.


SEC Servizi commented Apr 14 '15, 5:43 a.m.

Did you solve that? Thanks in advance.


SEC Servizi commented Apr 14 '15, 12:19 p.m.

You're right.Thanks for the tip! Cheers.

2 answers



permanent link
Michele Pegoraro (1.8k14119103) | answered Apr 14 '15, 8:31 a.m.
 Yes, I've solved it.

You have to define a new resolver in your class:

private IRepositoryResolver resolver = new IRepositoryResolver() {
public ITeamRepository getRepoFor(String uri, UUID id) {
// Return the repository to be used
return repo;
}
};
And then use it on the getCheckinOperation like this:
ICheckinOperation cio = IOperationFactory.instance.getCheckinOperation(CommitDilemmaHandler.getDefault(),resolver);

permanent link
Chris McGee (50511117) | answered Dec 06 '12, 2:06 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
ICheckinOperation and IOperationFactory are not public API and are subject to change between releases. The documentation for the Java public API for client-side integration can be found in the "Plain Java Client Libraries API documentation" link on the RTC download page on jazz.net: https://jazz.net/downloads/rational-team-concert/releases/4.0?p=allDownloads

If you want to automate loading and checking in changes you could consider using the SCM CLI and it's new (as of 4.0) JSON output format:
https://jazz.net/library/article/1031/

Comments
Michele Pegoraro commented Dec 07 '12, 5:17 a.m.

Chris,

thanks for your answer. I'm aware that these are internal classes, but in many cases (this is not the only one) I really need to use them. In this specific case I cannot use the scm-cli because I need to perform many operation, not only check-in, in a correct sequence (find changes, add Jazz User properties, check-in, deliver, adding custom links to work-items...).

It's ok for me to investigate on changes in internal class, just it seems to me that this specific class has change nothing as interface but it is no more usable. Or, more likely, I just need to add some settings in order to make it runnable.. I was investigating also in test classes but I can't find other way to use it.

Your answer


Register or 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.