NP when accessing workflow states using java plain API
"How do I get state of a work item?" ("scm.exe compare blabla" does not output state of work item)
IProjectArea pr_area = …;
IWorkItemClient wiclient = (IWorkItemClient)repo.getClientLibrary(IWorkItemClient.class);
List<IWorkItemType> witypes = wiclient.findWorkItemTypes(pr_area, null);
Calling findWorkItemTypes() gives NullPointerException. See attached trace.
We also need to get info about state on work items:
IWorkItem iwi = ...;
IWorkItemClient wiiClient = (IWorkItemClient)repo.getClientLibrary(IWorkItemClient.class);
IWorkflowInfo info = wiiClient.findWorkflowInfo(iwi, null);
Calling findWorkflowInfo() also gives a NullPointerException ending in same line of org.apache.xerces.util.ParserConfigurationSettings.java
Any input on how to move ahead is welcome :-)
Stacktrace:
13:09:08 [E] Caused by: java.lang.NullPointerException
13:09:08 [E] at java.util.Hashtable.put(Hashtable.java:542)
13:09:08 [E] at org.apache.xerces.util.ParserConfigurationSettings.setProperty(Unknown Source)
13:09:08 [E] at org.apache.xerces.parsers.XML11Configuration.setProperty(Unknown Source)
13:09:08 [E] at org.apache.xerces.parsers.AbstractSAXParser.setProperty(Unknown Source)
13:09:08 [E] at com.ibm.team.process.internal.common.model.ModelGenerator.enableValidation(ModelGenerator.java:106)
13:09:08 [E] at com.ibm.team.process.internal.common.model.ModelGenerator.generate(ModelGenerator.java:86)
13:09:08 [E] at com.ibm.team.process.internal.client.ThinClientProcess.createConfigurationData(ThinClientProcess.java:342)
13:09:08 [E] at com.ibm.team.process.internal.client.ThinClientProcess.getProjectConfigurationData(ThinClientProcess.java:280)
13:09:08 [E] at com.ibm.team.workitem.client.internal.AuditableClientProcess.findProcessConfiguration(AuditableClientProcess.java:72)
13:09:08 [E] at com.ibm.team.workitem.common.internal.ConfigurationItemManager.resolveProcessConfiguration(ConfigurationItemManager.java:124)
13:09:08 [E] at com.ibm.team.workitem.common.internal.ConfigurationItemManager.readConfigurationItems(ConfigurationItemManager.java:107)
13:09:08 [E] at com.ibm.team.workitem.common.internal.WorkItemTypeManager.readConfigurationItems(WorkItemTypeManager.java:370)
13:09:08 [E] at com.ibm.team.workitem.common.internal.ConfigurationItemManager.updateCache(ConfigurationItemManager.java:99)
13:09:08 [E] at com.ibm.team.workitem.common.internal.util.CacheHelper.internalCheckCache(CacheHelper.java:107)
13:09:08 [E] at com.ibm.team.workitem.common.internal.util.CacheHelper.checkCache(CacheHelper.java:73)
13:09:08 [E] at com.ibm.team.workitem.common.internal.util.CacheHelper.checkCache(CacheHelper.java:65)
13:09:08 [E] at com.ibm.team.workitem.common.internal.ConfigurationItemManager.findConfigurationItems(ConfigurationItemManager.java:48)
13:09:08 [E] at com.ibm.team.workitem.common.internal.WorkItemCommon.findWorkItemTypes(WorkItemCommon.java:408)
13:09:08 [E] at com.systematic.javaenv.internal.teamconcert.changequery.RTC.defineBasics(RTC.java:165)
13:09:08 [E] at com.systematic.javaenv.internal.teamconcert.changequery.RTC.execute(RTC.java:112)
13:09:08 [E] ... 21 more
2 answers
IWorkItemClient workItemClient= (IWorkItemClient)repo.getClientLibrary(IWorkItemClient.class); IWorkItem handle= workItemClient.findWorkItemById(workItemId, IWorkItem.SMALL_PROFILE, monitor);Do you have com.ibm.team.workitem.client listed as a required bundle in your plugin's manifest?
Comments
Susan Hanson
Jan 29 '14, 7:04 a.m.Have you looked at if you are getting a WorkItemClient back from your first line?
I have code that basically does the same thing for fineWorkflowInfo(workItem,null) from the WorkItemClient() and for findWorkItemTypes(project_area,null).
Susan