create new workitem from plugin
Hi,
i have developed the plain java code for creating new workitem.
Its working fine. while implementing this code with plug in.
The following error occured.
java.lang.ClassCastException: com.ibm.team.process.internal.rcp.ui.RepositoryCertificateHandler incompatible with com.ibm.team.repository.client.ICertificateHandler
at com.ibm.team.repository.client.internal.CertificateHandlerExtensionReader$Descriptor.getHandler(CertificateHandlerExtensionReader.java:146)
at com.ibm.team.repository.client.internal.CertificateHandlerExtensionReader.getHighestPriorityHandler(CertificateHandlerExtensionReader.java:101)
at com.ibm.team.repository.client.internal.TeamRepository.getCertificateHandler(TeamRepository.java:1608)
at com.ibm.team.repository.client.internal.TeamRepository.<init>(TeamRepository.java:323)
at com.ibm.team.repository.client.internal.TeamRepositoryService.createSharedTeamRepository(TeamRepositoryService.java:366)
at com.ibm.team.repository.client.internal.TeamRepositoryService.getTeamRepository(TeamRepositoryService.java:91)
at com.ibm.team.repository.client.internal.TeamRepositoryService.getTeamRepository(TeamRepositoryService.java:110)
Thanks,
pugazh
i have developed the plain java code for creating new workitem.
Its working fine. while implementing this code with plug in.
The following error occured.
java.lang.ClassCastException: com.ibm.team.process.internal.rcp.ui.RepositoryCertificateHandler incompatible with com.ibm.team.repository.client.ICertificateHandler
at com.ibm.team.repository.client.internal.CertificateHandlerExtensionReader$Descriptor.getHandler(CertificateHandlerExtensionReader.java:146)
at com.ibm.team.repository.client.internal.CertificateHandlerExtensionReader.getHighestPriorityHandler(CertificateHandlerExtensionReader.java:101)
at com.ibm.team.repository.client.internal.TeamRepository.getCertificateHandler(TeamRepository.java:1608)
at com.ibm.team.repository.client.internal.TeamRepository.<init>(TeamRepository.java:323)
at com.ibm.team.repository.client.internal.TeamRepositoryService.createSharedTeamRepository(TeamRepositoryService.java:366)
at com.ibm.team.repository.client.internal.TeamRepositoryService.getTeamRepository(TeamRepositoryService.java:91)
at com.ibm.team.repository.client.internal.TeamRepositoryService.getTeamRepository(TeamRepositoryService.java:110)
Thanks,
pugazh
Accepted answer
On Thu, 15 Mar 2012 15:27:12 +0000, pugazhsami wrote:
Defining current outside of the project context can be tricky as there
can be several repository connections connecting to many projects. You
could get all of the repository connections and then use the first one in
the resulting array for example:
public static ITeamRepository getDefaultRepository()
{
ITeamRepository[] repositories =
TeamPlatform.getTeamRepositoryService().getTeamRepositories();
if (repositories.length == 1) {
return repositories;
}
boolean found = false;
ITeamRepository targetRepository = null;
for (int i = 0; i < repositories.length; i++) {
ITeamRepository teamRepository = repositories;
if (teamRepository.loggedIn()) {
if (found) {
targetRepository = null;
} else {
targetRepository = teamRepository;
found = true;
}
}
}
return targetRepository;
}
--
Boris Kuschel
Jazz Jumpstart Team - IBM Software, Rational
My Blog: http://blog.boriskuschel.com/
--------------------------------------------------------------------------
This post represents my own opinion, thoughts, and conclusions based on my
knowledge of Jazz and the Jazz solutions.
For details on receiving official IBM Rational support please go to:
https://jazz.net/community/support/
Hi,
i have followed this topic (plain java cleint) for creating workitem.
https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation
Its working fine. i can able to creating workitem from this.
Actually i want to create new work item.
Like when a user clicked new menu Create Workitem.
Then we shown form with text box and radio ..etc.
when user submit the form . i want to save this into RTC.
The above example using User name and password and URI to connect RTC
server. But i want use current repository connection.
Kindly give me any idea or guide.
Thanks,
Pugazh
Defining current outside of the project context can be tricky as there
can be several repository connections connecting to many projects. You
could get all of the repository connections and then use the first one in
the resulting array for example:
public static ITeamRepository getDefaultRepository()
{
ITeamRepository[] repositories =
TeamPlatform.getTeamRepositoryService().getTeamRepositories();
if (repositories.length == 1) {
return repositories;
}
boolean found = false;
ITeamRepository targetRepository = null;
for (int i = 0; i < repositories.length; i++) {
ITeamRepository teamRepository = repositories;
if (teamRepository.loggedIn()) {
if (found) {
targetRepository = null;
} else {
targetRepository = teamRepository;
found = true;
}
}
}
return targetRepository;
}
--
Boris Kuschel
Jazz Jumpstart Team - IBM Software, Rational
My Blog: http://blog.boriskuschel.com/
--------------------------------------------------------------------------
This post represents my own opinion, thoughts, and conclusions based on my
knowledge of Jazz and the Jazz solutions.
For details on receiving official IBM Rational support please go to:
https://jazz.net/community/support/
3 other answers
On Thu, 15 Mar 2012 05:13:10 +0000, pugazhsami wrote:
$Descriptor.getHandler(CertificateHandlerExtensionReader.java:146)
(CertificateHandlerExtensionReader.java:101)
(TeamRepository.java:1608)
(TeamRepositoryService.java:366)
(TeamRepositoryService.java:91)
(TeamRepositoryService.java:110)
The two packages are different so this a good indication that perhaps
there is a problem somewhere. Could you give a little more context to the
problem. What is the code leading up to this exception?
--
Boris Kuschel
Jazz Jumpstart Team - IBM Software, Rational
My Blog: http://blog.boriskuschel.com/
--------------------------------------------------------------------------
This post represents my own opinion, thoughts, and conclusions based on my
knowledge of Jazz and the Jazz solutions.
For details on receiving official IBM Rational support please go to:
https://jazz.net/community/support/
Hi,
i have developed the plain java code for creating new workitem.
Its working fine. while implementing this code with plug in.
The following error occured.
java.lang.ClassCastException:
com.ibm.team.process.internal.rcp.ui.RepositoryCertificateHandler
incompatible with com.ibm.team.repository.client.ICertificateHandler
at
com.ibm.team.repository.client.internal.CertificateHandlerExtensionReader
$Descriptor.getHandler(CertificateHandlerExtensionReader.java:146)
at
com.ibm.team.repository.client.internal.CertificateHandlerExtensionReader.getHighestPriorityHandler
(CertificateHandlerExtensionReader.java:101)
at
com.ibm.team.repository.client.internal.TeamRepository.getCertificateHandler
(TeamRepository.java:1608)
at
com.ibm.team.repository.client.internal.TeamRepository.<init
(TeamRepository.java:323)
at
com.ibm.team.repository.client.internal.TeamRepositoryService.createSharedTeamRepository
(TeamRepositoryService.java:366)
at
com.ibm.team.repository.client.internal.TeamRepositoryService.getTeamRepository
(TeamRepositoryService.java:91)
at
com.ibm.team.repository.client.internal.TeamRepositoryService.getTeamRepository
(TeamRepositoryService.java:110)
Thanks,
pugazh
The two packages are different so this a good indication that perhaps
there is a problem somewhere. Could you give a little more context to the
problem. What is the code leading up to this exception?
--
Boris Kuschel
Jazz Jumpstart Team - IBM Software, Rational
My Blog: http://blog.boriskuschel.com/
--------------------------------------------------------------------------
This post represents my own opinion, thoughts, and conclusions based on my
knowledge of Jazz and the Jazz solutions.
For details on receiving official IBM Rational support please go to:
https://jazz.net/community/support/