It's all about the answers!

Ask a question

RTC API - scmService, Operation adviser fails to instantiate.

Zaid Al-Khishman (35915) | asked Nov 17 '14, 2:53 p.m.
edited Nov 18 '14, 1:24 p.m.
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)

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=""/>

But that's causing the Operation Adviser to fail to instantiate with this error message

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: CRJAZ1094I The service "sesp.AbstractService" failed to be activated because a service it depends on, "", has not been acquired and forcing service activation was not requested.

If I dont include that xml tag I get this:

An unhandled exception occurred during "send_email_server_plugin".

The service 'send_email_server_plugin.AbstractService@7d2b7d2b' failed to find the required service 'interface'.  Check <prerequisites> in plugin.xml.

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/] ERROR t.internal.registry.AbstractActivationManagerOwner  - The class "" 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 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

permanent link
sam detweiler (12.5k6185201) | answered Nov 17 '14, 3:58 p.m.
edited Nov 17 '14, 4:00 p.m.
here is the xml for most of my scm participant

            name="RTC SCM Deliver hook"
                    <requiredService interface=""/>
                    <requiredService interface=""/>
                    <requiredService interface=""/>
                    <requiredService interface=""/>
                    <requiredService interface=""/>
                    <requiredService interface=""/>
                    <requiredService interface=""/>
                    <requiredService interface=""/>
                fire hook script after deliver is completed

and my class definition
public class DeliverHook extends AbstractService implements IOperationParticipant
Zaid Al-Khishman selected this answer as the correct answer

Zaid Al-Khishman commented Nov 17 '14, 4:12 p.m. | edited Nov 17 '14, 5:02 p.m.

Hi Sam, that looks a lot like what I have here

            <prerequisites>                <requiredService                    interface=""/>               <!-- <requiredService                    interface=""/> -->
I thought this looked interesting though:

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


and try to ctrl-f
Starting the bundle "

I don't find anything. on the other hand
doing ctrl-f
Starting the bundle "

returns a match. I figure this may be the problem, except now I don't know how to force the server to start the service

sam detweiler commented Nov 17 '14, 6:11 p.m.

I looked at this some more.. I think if you extend AbstractScmService, then the
api method getScmService(); will do the job and u don't need the prereq

on a blank line hit ctrl-spacebar to see all the methods available

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?

Ralph Schoon commented Nov 18 '14, 11:30 a.m.

If there is a service start error, you should be able to see this on the diagnostics page. There should be a red cross. is an example for such an operation. Note, you extend the AbstractSCMService not AbstracService. You might also want to try Jetty first, if you don't to make sure everything works i a test environment.
The log files should also show errors if the services can be loaded.

Please be a ware that not all that looks like a service needs to be in the prerequisites. I have seen some that would cause trouble if you put them there. Best is to have a small list and only add that if the error message comes up that it is needed.

One other answer

permanent link
sam detweiler (12.5k6185201) | answered Nov 18 '14, 11:52 a.m.
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 plugin
eclipse plugins view, find by name, right click, import as source

class RequiredContentAdvisor

there are a couple other plugins in this folder too..

Your answer

Register or to post your answer.