RTC API - scmService, Operation adviser fails to instantiate.
Final Edit:
The problem was indeed in the xml tag, it should be, as Sam mentioned
notice the .common in contrast to .service extending AbstractService then calling IScmService scmService = getService(IScmService.class); or extending AbstractScmService then calling IScmService scmService = getScmService(); both approaches work given that the tag is included although the former seems to be the safer way to go (according to eclipse's warnings) Problem: I'm trying to create an OperationAdviser that uses this service IScmService scmService = getService(IScmService.class); What's the corresponding required service's interface's name that needs to go in the plugin.xml file? Where can I find a list of those services ? at the moment I'm using <requiredService interface="com.ibm.team.scm.service.IScmService"/> But that's causing the Operation Adviser to fail to instantiate with this error message Problem Unable to instantiate advisor operationAdvisor. CRJAZ6010E The operation advisor cannot be created because an exception occurred. For more information, see the exception. This is the exception, it's extracted from the server log: com.ibm.team.repository.common.transport.TeamServiceRegistryException: CRJAZ1094I The service "sesp.AbstractService" failed to be activated because a service it depends on, "com.ibm.team.scm.service.IScmService", has not been acquired and forcing service activation was not requested. If I dont include that xml tag I get this:
I also tried extending AbstractScmService instead of AbstractService and I get this exception instead (this is with the tag included) 2014-11-17 14:47:38,007 [http-bio-9443-exec-17 @@ 14:47 Z /ccm/service/com.ibm.team.scm.common.IScmService] ERROR t.internal.registry.AbstractActivationManagerOwner - The class "com.ibm.team.scm.service.IScmService" failed to load. The bundle "sesp" could not find the class. I've had a similar problem before but the exception wasn't thrown until the getService() function was executed. In other words the class had been instantiated successfully EDIT: I also have com.ibm.team.scm.service as a plug-in dependency. Although I'm not sure if that's needed INFO: RTC 4.0.7 with stock JDK/SDK/Plainjava |
Accepted answer
here is the xml for most of my scm participant
<extension point="com.ibm.team.process.service.operationParticipants"> <operationParticipant class="com.sd.tools.DeliverHook" id="com.sd.tools.deliver.hook.particpant" name="RTC SCM Deliver hook" operationId="com.ibm.team.scm.server.deliver"> <extensionService componentId="com.sd.tools.deliver.hook.particpant.component" implementationClass="com.sd.tools.DeliverHook"> <prerequisites> <requiredService interface="com.ibm.team.repository.service.IRepositoryItemService"/> <requiredService interface="com.ibm.team.repository.service.internal.IComponentMetadataProviderManagerService"/> <requiredService interface="com.ibm.team.scm.common.IScmService"/> <requiredService interface="com.ibm.team.process.service.IProcessServerService"/> <requiredService interface="com.ibm.team.repository.service.IServerQueryService"/> <requiredService interface="com.ibm.team.scm.common.internal.IScmQueryService"/> <requiredService interface="com.ibm.team.repository.service.ITransactionService"/> <requiredService interface="com.ibm.team.workitem.service.IAuditableServer"/> </prerequisites> </extensionService> <description> fire hook script after deliver is completed </description> </operationParticipant> and my class definition public class DeliverHook extends AbstractService implements IOperationParticipant { } Zaid Al-Khishman selected this answer as the correct answer
Comments Hi Sam, that looks a lot like what I have here
<prerequisites> <requiredService interface="com.ibm.team.repository.service.IRepositoryItemService"/> <!-- <requiredService interface="com.ibm.team.scm.service.IScmService"/> -->I thought this looked interesting though: https://jazz.net/forum/questions/102417/abstractscmadvisor-how-do-you-read-changed-file-content particularly the comment right about the binding. It may be a service that requires manual activation. The server I'm using has only been installed recently.
Zaid Al-Khishman
commented Nov 17 '14, 4:16 p.m.
Moreover if we look at the provision status
sam detweiler
commented Nov 17 '14, 6:11 p.m.
I looked at this some more.. I think if you extend AbstractScmService, then the
Zaid Al-Khishman
commented Nov 17 '14, 10:39 p.m.
Same error. I think it's probably because scm.service isn't running in the first place (unlike repository.service which seems to be very similar in concept and is working) how would I go about enabling it?
1
Ralph Schoon
commented Nov 18 '14, 11:30 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
If there is a service start error, you should be able to see this on the diagnostics page. There should be a red cross.
|
One other answer
One thing that might help also, is to look at the source for one of the product provided plugins..
the one that seems most useful to me most times is the required content participant. it is located in the com.ibm.team.filesystem.service plugin eclipse plugins view, find by name, right click, import as source package com.ibm.team.filesystem.service.internal.process class RequiredContentAdvisor there are a couple other plugins in this folder too.. |
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.