It's all about the answers!

Ask a question

create new workitem from plugin


pugazhenthi samidurai (26423942) | asked Mar 15 '12, 1:07 a.m.
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

Accepted answer


permanent link
Boris Kuschel (331113) | answered Mar 16 '12, 3:29 a.m.
JAZZ DEVELOPER
On Thu, 15 Mar 2012 15:27:12 +0000, pugazhsami wrote:

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/
pugazhenthi samidurai selected this answer as the correct answer

3 other answers



permanent link
Boris Kuschel (331113) | answered Mar 15 '12, 4:05 a.m.
JAZZ DEVELOPER
On Thu, 15 Mar 2012 05:13:10 +0000, pugazhsami wrote:

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/

permanent link
pugazhenthi samidurai (26423942) | answered Mar 15 '12, 11:19 a.m.
Hi,

please check this post.


https://jazz.net/forums/viewtopic.php?t=23352&highlight=plugin


Kindly give me any idea or guide.

Thanks,

Pugazh

permanent link
pugazhenthi samidurai (26423942) | answered Mar 17 '12, 6:39 a.m.
Hi Boris,

Thanks u very much.

Now its working fine.

Thanks,

Pugazh

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.