error while invoking getClientLibrary(IWorkItemClient.class
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
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
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.