It's all about the answers!

Ask a question

When an ICopyFileArea could be null?


Michele Pegoraro (1.8k14119103) | asked Jul 03 '12, 1:17 p.m.
Hi,
I've a plain java extension which set some jazz user properties and then perform a check-in. Everything it is ok if I work with elements that belong to an eclipse project, but when I set properties on a project I've some problem.

During the ICheckInOperation I get a NullPointerException because 

ICopyFileArea cfa = CopyFileAreaManager.instance.getCopyFileAreaForPath(sbox.getRoot());

seems to be null. I don't know how this object is used, but does anybody know what can cause this behaviour?

Thanks,
Michele.

Comments
Michele Pegoraro commented Apr 03 '13, 4:49 a.m. | edited Apr 05 '13, 9:11 a.m.

I still have this problem. The thing is that I don't use directly CFA, but when I try to use ICheckInOperation it gives me a NPE because the CFA is null. I've find out that I could resolve this problem deleting and reloading the workspace using scmtools before to run another check-in. So it seems that after running an ICheckInOperation the workspace becomes instable. Is there any way to refresh some metadata in order to use it again without reload it?


This because I've created a check-in and delivery ant task and with this problem I cannot use it more than one time in a single ant.

Thanks,
Michele.


Evan Hughes commented Apr 05 '13, 9:13 a.m.
JAZZ DEVELOPER

Have you tried the approach mentioned in the first question? (ie use ISharingManager.getSandbox() to ensure the sandbox has been registered)

2 answers



permanent link
Evan Hughes (2.4k1318) | answered Jul 04 '12, 10:58 a.m.
JAZZ DEVELOPER
The manager doesn't know about a CFA at that path. Have you registered the sandbox before making that call? It likely works in Eclipse because RTC automatically registers sandboxes on startup. 

The CFAManager is marked as internal, so you should avoid using it if possible. Can you use the ISharingManager instead? Since our APIs aren't well defined, the command line interface would be an even better choice (if possible). 

Comments
Stefano Antoniazzi commented May 10 '16, 9:57 a.m.

 Does this mean that a clean close outside Eclipse should also invoke sharingManager.deregister(sandbox, progressMonitor); ?


permanent link
Michele Pegoraro (1.8k14119103) | answered Aug 01 '13, 9:44 a.m.
 I found out that the problem is in version 4 SDK and is related to the implementation of IRepositoryResolver that seems buggy or not so right.

As I already have an ITeamRepository (obtained using the login functions) I ovverride the resolver method:

private IRepositoryResolver resolver = new IRepositoryResolver() {
public ITeamRepository getRepoFor(String uri, UUID id) {
// Return the repository to be used
return repo;
}
};

So, if I use this resolver in the getCheckinOperation method it runs correctly.

Michele.

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.