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

workItemClient.findWorkItemById throws error java.lang.NoClassDefFoundError: com/ibm/team/workitem/api/common/connectors/IDataConnector

Hello,

I am doing my first tries with the Java Plain API just looking for a WokItem a show it through Groovy script like my first test.

Part of my simple code is:

import org.eclipse.core.runtime.IProgressMonitor;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

import com.ibm.team.filesystem.common.workitems.ILinkConstants;
import com.ibm.team.links.client.ILinkManager;
import com.ibm.team.links.common.IItemReference;
import com.ibm.team.links.common.ILink;
import com.ibm.team.links.common.ILinkCollection;
import com.ibm.team.repository.client.IItemManager;
import com.ibm.team.repository.client.ILoginHandler2;
import com.ibm.team.repository.client.ILoginInfo2;
import com.ibm.team.repository.client.ITeamRepository;
import com.ibm.team.repository.client.TeamPlatform;
import com.ibm.team.repository.client.login.UsernameAndPasswordLoginInfo;
import com.ibm.team.repository.common.TeamRepositoryException;
import com.ibm.team.scm.client.IWorkspaceManager;
import com.ibm.team.scm.common.IChange;
import com.ibm.team.scm.common.IChangeSet;
import com.ibm.team.scm.common.IChangeSetHandle;
import com.ibm.team.scm.common.IVersionable;
import com.ibm.team.scm.common.IVersionableHandle;
import com.ibm.team.workitem.client.IWorkItemClient;
import com.ibm.team.workitem.common.model.IWorkItem;

....

try {
 println "hello in Try"
 
 // Login to the repository using the provided credentials
 ITeamRepository repo = TeamPlatform.getTeamRepositoryService().getTeamRepository(repoUri);
 repo.registerLoginHandler(new ILoginHandler2() {
  @Override
  public ILoginInfo2 challenge(ITeamRepository arg0) {
   return new UsernameAndPasswordLoginInfo(userId, password);
  }
 });
 repo.login(new SysoutProgressMonitor());
 println "I've logged in successfuly"
 
 

 
 // Find the work item on the server
 def workItemClient = (IWorkItemClient)repo.getClientLibrary(IWorkItemClient.class);
 
 int workItemNumber = -1;
   
 try {
  workItemNumber = Integer.parseInt(wi);
 } catch (NumberFormatException e) {
  println("Invalid work item nubmer:" + wi);
  exit(1);
 }
   
 def workItem = workItemClient.findWorkItemById(workItemNumber, IWorkItem.FULL_PROFILE, new SysoutProgressMonitor());
 println("["+workItem.getId()+"] "+workItem.getHTMLSummary().getPlainText());
 

 repo.logout();
} finally {
 TeamPlatform.shutdown();
}

 

....

 

 

 

But I get the following error in my console:

 >groovy script.groovy


hello
hello in Try
I've logged in successfuly
Caught: java.lang.NoClassDefFoundError: com/ibm/team/workitem/api/common/connectors/IDataConnector
java.lang.NoClassDefFoundError: com/ibm/team/workitem/api/common/connectors/IDataConnector
        at script.run(script.groovy:67)
Caused by: java.lang.ClassNotFoundException: com.ibm.team.workitem.api.common.connectors.IDataConnector
        ... 1 more

 

 I have added API jars into my <user>/.groovy/lib

so I can import them into my script,

but there I cannot see a jar file named like in the error com.ibm.team.workitem.api.common.connectors.IDataConnector

The version I am is the 4.0.2 and jars are too,

How could I fix the error? Should I download the missing jar from somewhere? 

 

Thanks for the help.

0 votes


Accepted answer

Permanent link
that jar file is in the sdk, plugins folder

com.ibm.team.workitem.api.common_3.1.300.v20130429_0038.jar
Tiago Fernandez selected this answer as the correct answer

0 votes

Comments

Thank you,

I found the jar in the RTC eclipse plugins folder, then I added it in my import list and it worked.

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,936
× 478
× 343
× 169

Question asked: Aug 09 '13, 4:27 p.m.

Question was seen: 6,482 times

Last updated: Aug 12 '13, 2:24 p.m.

Confirmation Cancel Confirm