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

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)

We've tried the following:
 Given some project area, we need to locate the work item types:

  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


0 votes

Comments

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



2 answers

Permanent link
Issue has been solved. There was no problem with code. Initially, the code was executed from within an Ant context (http://ant.apache.org). Somehow Ant apparently made certain properties inaccessible. When running the job without Ant, but with the same java + jars, the code works fine.

2 votes


Permanent link
As Susan suggests, it sounds like your work item client is null.  I have very similar code that works:
  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?

0 votes

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
× 10,951

Question asked: Jan 29 '14, 3:01 a.m.

Question was seen: 4,078 times

Last updated: Jan 29 '14, 9:02 a.m.

Confirmation Cancel Confirm