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

BadLocationException when querying for work items using Java API

java.lang.NoClassDefFoundError: org.eclipse.jface.text.BadLocationException
    at java.lang.J9VMInternals.verifyImpl(Native Method)
    at java.lang.J9VMInternals.verify(J9VMInternals.java:72)
    at java.lang.J9VMInternals.verify(J9VMInternals.java:70)
    at java.lang.J9VMInternals.verify(J9VMInternals.java:70)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:134)
    at com.ibm.team.process.internal.common.util.AbstractProcess.computeConfigurationData(AbstractProcess.java:325)
    at com.ibm.team.process.internal.common.util.AbstractProcess.getProjectConfigurationData(AbstractProcess.java:313)
    at com.ibm.team.process.internal.common.util.AbstractProcess.getProjectConfigurationData(AbstractProcess.java:299)
    at com.ibm.team.workitem.client.internal.AuditableClientProcess.findProcessConfiguration(AuditableClientProcess.java:68)
    at com.ibm.team.workitem.common.internal.EnumerationManager$InternalEnumerations.resolve(EnumerationManager.java:52)
    at com.ibm.team.workitem.common.internal.EnumerationManager.updateCache(EnumerationManager.java:198)
    at com.ibm.team.workitem.common.internal.util.CacheHelper.internalCheckCache(CacheHelper.java:131)
    at com.ibm.team.workitem.common.internal.util.CacheHelper.checkCache(CacheHelper.java:81)
    at com.ibm.team.workitem.common.internal.util.CacheHelper.checkCache(CacheHelper.java:72)
    at com.ibm.team.workitem.common.internal.EnumerationManager.internalResolve(EnumerationManager.java:173)
    at com.ibm.team.workitem.common.internal.EnumerationManager.resolve(EnumerationManager.java:169)
    at com.ibm.team.workitem.common.internal.WorkItemCommon.resolveEnumeration(WorkItemCommon.java:453)
    at com.ibm.team.workitem.common.internal.model.EnumerationAttributeType.getNullValue(EnumerationAttributeType.java:41)
    at com.ibm.team.workitem.common.internal.model.impl.AttributeImpl.getNullValue(AttributeImpl.java:875)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:600)
    at com.ibm.team.repository.common.internal.util.ItemStore$ItemInvocationHandler.invoke(ItemStore.java:597)
    at $Proxy16.getNullValue(Unknown Source)
    at com.ibm.team.workitem.common.internal.expression.WorkItemQueryAttributeFactory.getNullValue(WorkItemQueryAttributeFactory.java:274)
    at com.ibm.team.workitem.common.internal.expression.WorkItemQueryAttributeFactory.findNonLinkAttributes(WorkItemQueryAttributeFactory.java:238)
    at com.ibm.team.workitem.common.internal.expression.WorkItemQueryAttributeFactory.updateCache(WorkItemQueryAttributeFactory.java:172)
    at com.ibm.team.workitem.common.internal.util.CacheHelper.internalCheckCache(CacheHelper.java:131)
    at com.ibm.team.workitem.common.internal.util.CacheHelper.checkCache(CacheHelper.java:81)
    at com.ibm.team.workitem.common.internal.expression.WorkItemQueryAttributeFactory.findAttribute(WorkItemQueryAttributeFactory.java:137)
    at
com.nbn.ib2b.infra.scm.common.RTCWorkItemManager.printWorkItemTypes(RTCWorkItemManager.java:105)
    at com.nbn.ib2b.infra.scm.SCMQueryWorkItems.executeQuery(SCMQueryWorkItems.java:73)
    at com.nbn.ib2b.infra.scm.SCMQueryWorkItems.run(SCMQueryWorkItems.java:40)
    at com.nbn.ib2b.infra.scm.common.RTCBase.execute(RTCBase.java:187)
    at com.nbn.ib2b.infra.scm.test.SCMQueryWorkItemsTest.testExecute(SCMQueryWorkItemsTest.java:13)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:600)
    at junit.framework.TestCase.runTest(TestCase.java:164)
    at junit.framework.TestCase.runBare(TestCase.java:130)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:120)
    at junit.framework.TestSuite.runTest(TestSuite.java:230)
    at junit.framework.TestSuite.run(TestSuite.java:225)
    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jface.text.BadLocationException
    at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:77)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:383)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:346)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
    ... 54 more



Getting above stack trace when running a simple snippet as gathered from other posts on forum (this bit is what's in 'printWorkItemTypes'):

       IProjectArea projectArea = findProjectArea(projectAreaName);
       IQueryableAttributeFactory attFactory = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE);

      IQueryableAttribute workItemTypeAttribute = attFactory.findAttribute(projectArea, IWorkItem.TYPE_PROPERTY, auditableClient, null);
     
The projectArea and auditableClient values are valid, so I'm a bit stuck at the minute.


0 votes



2 answers

Permanent link
Ah, don't worry, had to figure out that I was missing "org.eclipse.text" JAR in my classpath as opposed to "org.eclipse.jface.text" ... it works now :)

On the same topic though, how do I find all "work item types"? My project has customized types I'm trying to find the IDs of, but the following does not print what I need?

      for(IQueryableAttribute attribute: workItemTypeAttribute.getChildAttributes())
      {
         System.out.println("Work item type:" +attribute.getDisplayName());
         workItemTypes.add(attribute.getDisplayName());
      }

0 votes


Permanent link
Worked that one out too, thanks.

       IWorkItemCommon workItemClient = (IWorkItemCommon)teamRepository.getClientLibrary(IWorkItemCommon.class);
       List<IWorkItemType> workItemTypes = workItemClient.findWorkItemTypes(projectArea,progressMonitor);

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
× 457
× 235
× 89
× 57
× 12

Question asked: Oct 24 '12, 9:12 a.m.

Question was seen: 5,151 times

Last updated: Oct 24 '12, 10:21 a.m.

Confirmation Cancel Confirm