OSGI/Blueprint/Service reference and bind method

I currently have two OSGi bundles (bundle1 and bundle2) bundle1 exposing service through a blueprint. In bundle2’s blueprint.xml i want to reference a service from bundle1 and Inject it into the bundle-activator (code below), as RuntimeEngine will be used to call createInstance().

Bundle1 context.xml is as follows:

<bean id="serviceBean"
    class="de.blogspot.wrongtracks.example.ServiceTaskBean" />

<bean id="processApplication"
    <argument ref="blueprintContainer"/>
    <argument ref="blueprintBundleContext"/>

<service ref="processApplication"
    interface="org.camunda.bpm.application.ProcessApplicationInterface" />

 <bean id="runtimeEngine"

<service ref="runtimeEngine"
    interface="de.blogspot.wrongtracks.example.RuntimeEngine" /> 
Bundle2 context.xml is as follows:

RuntimeEngine Interface:

public interface RuntimeEngine {

public boolean createInstance(Map<String, Object> variables);

Runtimeengine Impl class:

public class RuntimeEngineImpl implements RuntimeEngine {

private final Logger LOGGER = Logger.getLogger(RuntimeEngine.class.getName());
private RuntimeService runtimeService;

public boolean createInstance(Map<String, Object> variables) {
    LOGGER.severe("Inside createInstance" + variables);
    System.out.println("inside createinstance");
    if (Objects.isNull(runtimeService)) {
        runtimeService = BpmPlatform.getDefaultProcessEngine().getRuntimeService();

    ProcessInstance instance = runtimeService.startProcessInstanceByKey("Process_1", variables);

    LOGGER.severe("Executed : " + instance.getProcessDefinitionId());
    return instance.isEnded();

Activator class:

public class Activator implements BundleActivator {

public void start(final BundleContext context) throws Exception {
    System.out.println("blueprint bundle activator called");

public void stop(final BundleContext context) throws Exception {

private RuntimeEngine runtime;

public void onBindService(RuntimeEngine aRuntime) {
    runtime = aRuntime;
    System.out.println("Inside onbind");

    Map<String, Object> variables = new HashMap<String, Object>();



public void onUnbindService(RuntimeEngine aRuntime) {


The problem is when i try to start this bundle in my karaf,it failed and error in log file is as follows:

There are multiple occurrences of ID value ‘runtimeEngine’ (I tried to print statement in Activator class and it is going inside my activator class but it is not going inside my onBindService).

What should i do so that when i start this bundle it call its bind method?Any suggestions?