Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

0 votes


Accepted answer

Permanent link
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

0 votes


3 other answers

Permanent link
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/

0 votes


Permanent link
Hi,

please check this post.


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


Kindly give me any idea or guide.

Thanks,

Pugazh

0 votes


Permanent link
Hi Boris,

Thanks u very much.

Now its working fine.

Thanks,

Pugazh

0 votes

Your answer

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

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,941

Question asked: Mar 15 '12, 1:07 a.m.

Question was seen: 4,899 times

Last updated: Mar 15 '12, 1:07 a.m.

Confirmation Cancel Confirm