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

When an ICopyFileArea could be null?

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.

0 votes

Comments

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.

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

1 vote

Comments

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


Permanent link
 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.

1 vote

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
× 12,019
× 10,934
× 411

Question asked: Jul 03 '12, 1:17 p.m.

Question was seen: 6,878 times

Last updated: May 10 '16, 9:57 a.m.

Confirmation Cancel Confirm