ClassCastException when trying to log into my repository
I try to programatically login into my server using this method:
However, i get the following exception:
I have no idea what I am doing wrong. Any hints?
ITeamRepository repository = TeamPlatform.getTeamRepositoryService().getTeamRepository(server);
However, i get the following exception:
Caused by: java.lang.ClassCastException: com.ibm.team.process.internal.rcp.ui.RepositoryCertificateHandler cannot be cast to com.ibm.team.repository.client.ICertificateHandler
at com.ibm.team.repository.client.internal.CertificateHandlerExtensionReader$Descriptor.getHandler(CertificateHandlerExtensionReader.java:147)
at com.ibm.team.repository.client.internal.CertificateHandlerExtensionReader.getHighestPriorityHandler(CertificateHandlerExtensionReader.java:102)
at com.ibm.team.repository.client.internal.TeamRepository.getCertificateHandler(TeamRepository.java:1884)
at com.ibm.team.repository.client.internal.TeamRepository.<init>(TeamRepository.java:370)
at com.ibm.team.repository.client.internal.TeamRepositoryService.createSharedTeamRepository(TeamRepositoryService.java:526)
at com.ibm.team.repository.client.internal.TeamRepositoryService.getTeamRepository(TeamRepositoryService.java:112)
at com.ibm.team.repository.client.internal.TeamRepositoryService.getTeamRepository(TeamRepositoryService.java:131)
I have no idea what I am doing wrong. Any hints?
One answer
Hi Sebastian,
I haven't hit this error before, so I'm not sure what could be causing it. https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation has an example of how to get the team repository. Maybe if you look through that code, you can see if there is something you are missing. Are you calling
TeamPlatform.startup()?
I haven't hit this error before, so I'm not sure what could be causing it. https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation has an example of how to get the team repository. Maybe if you look through that code, you can see if there is something you are missing. Are you calling
TeamPlatform.startup()?