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

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?


0 votes

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.



3 answers

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

0 votes


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

0 votes

Comments

I mean the opposite, sorry :)

Participants run after the save has been done. Advisors run upfront and can block saves.

What is the use case, what are you trying to do? If we don't have the slightest idea what the extension is supposed to do, we can't help.

The example I provided is special, as it works with the SCM part when delivering and shows special classes to access the SCM system - since you mentioned that above.

All I am saying so far is, that you can't use a client API in the server (at least not easily) . Also there are examples that might (or might not) be interesting to you.

Thanks Ralph, this AbstractScmService is showing me a new world actually.
I'm reading the methods, what i'm trying to do is to access a file in a changeset and modify it. So i was thinking that i need a workspace connection but also that one is in the client api. Have you any snippet of code or a suggestion of how I can do it?

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.

Thanks again, i will take a look and let you know.


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


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,927

Question asked: Sep 08 '14, 5:46 a.m.

Question was seen: 7,548 times

Last updated: Sep 09 '14, 6:14 a.m.

Confirmation Cancel Confirm