It's all about the answers!

Ask a question

Can not find class IDataConnector


Melanie Finke (7731520) | asked Jun 03 '13, 7:10 a.m.
edited Jun 10 '13, 3:10 a.m.
Hallo,

I try to test my application using Mock classes for the plain java API.
My Problem is that IWorkItemClient has a Method returning IDataConnector.
I do not have the interface IDataConnector in the plain java API version 4.0.1.

Could you please show me where to find the interface.

The fully qualified name is: com.ibm.team.workitem.api.common.connectors.IDataConnector

Best regards,

Melanie


Comments
Piotr Aniola commented Jun 04 '13, 7:21 a.m.

What is the package in which the IDataConnector interface sits? The package name will lead us to the provider of this interface.

One answer



permanent link
Tiago Fernandez (5351619) | answered Aug 09 '13, 4:23 p.m.

Hello,

I am having the same error,

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

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,

How could I fix the error.

Thanks a lot.

Your answer


Register or 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.