service failed to activate because a service that it depends on, "com.ibm.team.repository.client.ITeamRepositoryService", is not registered.
I just cannot figure out why I have this problem.
I'm working on a server side extension and when I try to get a TeamRepositoryService I get this error in runtime. I'm working on a Jetty test environment and I get connected to the test server through a RTC client in localhost. When I catch a workitemsave event and I try to get the repo I get this error. /jazz/service/com.ibm.team.workitem.common.internal.IWorkItemRepositoryService] ERROR com.ibm.team.process.common - CRJAZ6011E The operation participant cannot be created because an exception occurred. For more information, see the exception. com.ibm.team.repository.common.transport.TeamServiceRegistryException: CRJAZ2671E The "net.jazz.rtcext.workitem.extensions.service.BuildOnStateChangeParticipant" service failed to activate because a service that it depends on, "com.ibm.team.repository.client.ITeamRepositoryService", is not registered. I tried in both the following ways ITeamRepository repo = TeamPlatform.getTeamRepositoryService().getTeamRepository("http://localhost:7443/jazz"); ITeamRepositoryService repoService = this.getService(ITeamRepositoryService.class); I added the requested service both in the manifest dependencies and plugin.xml as prerequisites Any idea of why I get this TeamServiceRegistryException? |
3 answers
Ralph Schoon (63.5k●3●36●46)
| answered Sep 08 '14, 11:24 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Sep 08 '14, 11:26 a.m.
This is an advisor for SCM operations. It might be a good starting point: https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/
ITeamRepository is client API. You can't use it on the server. You can't gerService() interfaces that are no services. |
So do you think that I have to use
public class MyPlugin extends AbstractService implements IOperationParticipant { instead of public class MyPlugin extends AbstractScmService implements IOperationAdvisor { ? Can't I use IOperationParticipant? Comments
Marco Gianfico
commented Sep 08 '14, 11:35 a.m.
I mean the opposite, sorry :)
Ralph Schoon
commented Sep 08 '14, 11:51 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Participants run after the save has been done. Advisors run upfront and can block saves.
Marco Gianfico
commented Sep 08 '14, 11:55 a.m.
Thanks Ralph, this AbstractScmService is showing me a new world actually.
Ralph Schoon
commented Sep 08 '14, 12:16 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I would think most of the methods used in the client API should be available. However, you have to use the server or the common API. The packages of the common api are usually named com.ibm.team.......common the server API is in packages com.ibm.team.......server. Both should be available in the server. Client API com.ibm.team.......client, is not. You can search on my blog for server API examples, but I don't think I have a lot of SCM code, especially for the server. Again, however, the server API, should have similar ways for most of the stuff.
Marco Gianfico
commented Sep 08 '14, 12:32 p.m.
Thanks again, i will take a look and let you know.
|
I'm sorry but i'm not able to find a solution to the problem.
The actions the i'd like to do are configuration.determineAncestorsInHistory(lst,getMon); but to do this i need IConfiguration configuration = workspaceConnection.configuration(component); and to do this i need IWorkspaceConnection workspaceConnection= workspaceManager.getWorkspaceConnection but these methods are client side so I cannot use them. So I cannot find a method to access files in the changeset. I've found IScmService.configurationDetermineAncestorInHistory but it need a ServiceConfigurationProvider and i don't know where to obtain this object. If anyone has suggestions or examples would be wonderful. It's strange that is possible (but not simple) to access files in the client side but quite difficult to do this on the server side. |
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.
Comments
the teamrepositoryservice is a client side api only.
your server side extension is running IN the repository.
what do you want to do in workitemsave?
I'm trying to access all the files included in a changeset.
So i need to access the workspace of the changeset.
what info do you have? workitem for sure.. link to a changeset?
Yes I have the changeset, iterating the changes I can get also the name of the files included in the changeset.
I also have the saveParameter, but nothing more interesting.