It's all about the answers!

Ask a question

error while invoking getClientLibrary(IWorkItemClient.class


Anna Wymysłowska (122) | asked Feb 07 '11, 10:24 a.m.
I try to configure a code which was working with RTC 1.0. I have upgraded jar files to 2.0 version. Everything seems fine (no compilation errors), but I get NullPointerException while invoking IWorkItemClient workItemClient= (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class);.


ArrayList<WorkItem> reopenList = new ArrayList<WorkItem>();
ITeamRepository teamRepository= TeamPlatform.getTeamRepositoryService().getTeamRepository(REPOSITORY_URI);
teamRepository.registerLoginHandler(new LoginHandler(userId, password));
teamRepository.login(null);

IProcessClientService processClient= (IProcessClientService) teamRepository.getClientLibrary(IProcessClientService.class);
IAuditableClient auditableClient= (IAuditableClient) teamRepository.getClientLibrary(IAuditableClient.class);
IWorkItemClient workItemClient= (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class);



Exception in thread "main" java.lang.NullPointerException
at com.ibm.team.workitem.common.internal.WorkItemCommon.<init>(WorkItemCommon.java:156)
at com.ibm.team.workitem.client.internal.WorkItemClient.<init>(WorkItemClient.java:362)
at com.ibm.team.workitem.client.internal.WorkItemClientLibraryFactory.createClientLibrary(WorkItemClientLibraryFactory.java:17)
at com.ibm.team.repository.client.internal.ClientLibraryFactoryRegistry.getClientLibrary(ClientLibraryFactoryRegistry.java:89)
at com.ibm.team.repository.client.internal.TeamRepository.getClientLibrary(TeamRepository.java:460)
at impl.CreateWorkItem.run(CreateWorkItem.java:251)
at impl.WorkItemImporter.main(WorkItemImporter.java:39)

I have no idea what can cause it... teamRepository object has proper login, password and uri.

One answer



permanent link
Eduardo Bello (4401821) | answered Feb 09 '11, 12:44 p.m.
It might look as a silly question, but did you check if you are using the same version of client libraries that the server is running (including iFix)?

Your answer


Register or to post your answer.