It's all about the answers!

Ask a question

Class compatibility issue while instantiating services using RTC client api


Nilesh Patil (1733550) | asked Mar 08 '16, 11:47 a.m.

Hi All,

I have created UI based eclipse plugin on top of RTC client. I am trying to instantiate IProcessItemService using RTC client api. I have used below

if(!TeamPlatform.isStarted()){

TeamPlatform.startup();

System.out.println("start up platform");

}

//TeamPlatform.startup();

String repoUri = "serverUrl";

TeamRepository repository = (TeamRepository) TeamPlatform.getTeamRepositoryService().getTeamRepository(repoUri);

repository.registerLoginHandler(new MyLoginHandler());

try {

repository.login(null);

IContributor user = repository.loggedInContributor();

com.ibm.team.process.client.IProcessItemService processItemService = (com.ibm.team.process.client.IProcessItemService) repository

.getClientLibrary(com.ibm.team.process.client.IProcessItemService.class);// This is where it throws classcast exception

} catch (TeamRepositoryException e1) {

e1.printStackTrace();

}

Could you please let me know where I am doing wrong thing or missing any inputs.

The log it shows is,

 java.lang.ClassCastException: com.ibm.team.process.internal.client.ProcessClientService incompatible with com.ibm.team.process.client.IProcessItemServiceat org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
...

Be the first one to answer this question!


Register or to post your answer.