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

Jazz Custom Attributes

I created a custom attribute to hold a particular string for work items, and im having some trouble receiving this attribute. Here is the code for the retieval of the work item.


IAttribute pv;
try {
pv = workItemClient.findAttribute(projectArea, "past_vote", monitor);
if (pv != null)
value = workItem.getValue(pv);
} catch (TeamRepositoryException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String v = "";
if (value != null)
v = value.toString();


I'm getting the following stack trace on the line value = workItem.getValue(pv);


org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:111)
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:97)
at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.getValue(WorkItemImpl.java:2777)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.ibm.team.repository.common.internal.util.ItemStore$ItemInvocationHandler.invoke(ItemStore.java:596)
at $Proxy25.getValue(Unknown Source)
at edu.ncsu.csc.wolfpoker.jazzclient.views.PokerSessionEditorFormPage.addToWorkItemTable(PokerSessionEditorFormPage.java:1215)
at edu.ncsu.csc.wolfpoker.jazzclient.views.PokerSessionEditorFormPage.refreshItemsToEstimate(PokerSessionEditorFormPage.java:651)
at edu.ncsu.csc.wolfpoker.jazzclient.views.PokerSessionEditorFormPage.initItemsSection(PokerSessionEditorFormPage.java:584)
at edu.ncsu.csc.wolfpoker.jazzclient.views.PokerSessionEditorFormPage.initSWTcomponent(PokerSessionEditorFormPage.java:250)
at edu.ncsu.csc.wolfpoker.jazzclient.views.PokerSessionEditorFormPage.createFormContent(PokerSessionEditorFormPage.java:1114)
at org.eclipse.ui.forms.editor.FormPage$1.run(FormPage.java:151)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.forms.editor.FormPage.createPartControl(FormPage.java:149)
at org.eclipse.ui.forms.editor.FormEditor.pageChange(FormEditor.java:488)
at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:973)
at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:623)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:314)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:661)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:428)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:306)
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1608)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)
at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)
at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:217)
at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:207)
at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:779)
at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:678)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:639)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2817)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2668)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2652)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2635)
at edu.ncsu.csc.wolfpoker.jazzclient.views.PokerSessionsDomain.openSession(PokerSessionsDomain.java:412)
at edu.ncsu.csc.wolfpoker.jazzclient.views.PokerSessionsDomain.open(PokerSessionsDomain.java:50)
at com.ibm.team.process.internal.rcp.ui.DomainNavigator.openSelection(DomainNavigator.java:948)
at com.ibm.team.process.internal.rcp.ui.DomainNavigator$2.open(DomainNavigator.java:203)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:818)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1079)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1183)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)


Any thoughts on this error? Thanks in advance.

0 votes



One answer

Permanent link
Any thoughts on this error? Thanks in advance.

There are two issues:

a) Work Items support partial loading. When you load the work item, make
sure that all its attributes are loaded, otherwise you might run into an
assertion failure. The easiest way (loading everything) is to use
IWorkItem.FULL_PROFILE when loading the work item using
IAuditableCommon.resolveAuditable(...)

b) Telling from the stack trace, you are performing long-running
operations that contact the server in the UI thread. This will also lead
to an error being logged (although the code will work). Long-running
operations in the UI thread freeze the UI and should be moved to a
background thread/Job.

--
Regards,
Patrick
RTC Work Item Component Lead

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,952

Question asked: Oct 25 '10, 12:30 a.m.

Question was seen: 4,378 times

Last updated: Oct 25 '10, 12:30 a.m.

Confirmation Cancel Confirm