AnsweredAssumed Answered

Activiti in OSGI -  unresolved dependencies

Question asked by marcelwolf on Nov 1, 2016
Latest reply on Nov 3, 2016 by vasile.dirla
Hey Everybody!

I try to get Activiti running in Karaf.


Here is my BluePrint:


<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/blueprint"
           xmlns:ext="http://camel.apache.org/schema/blueprint"
           xsi:schemaLocation="
       http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
       http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd"
           xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0"
           xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.0.0">

    <camelContext id="clientContext" trace="false" xmlns="http://camel.apache.org/schema/blueprint">
        <routeBuilder ref="routeBuilder" />       
        <route id="entryPointClient">
            <from uri="vm:client_queue"/>
            <to uri="jobsbpmn://bpmn"/>
        </route>
    </camelContext>

    <!– OSGI Engine –>

    <bean id="dataSource" class="org.h2.jdbcx.JdbcDataSource">
        <property name="URL" value="jdbc:h2:~/activiti" />
        <property name="user" value="sa" />
        <property name="password" value="" />
    </bean>

    <bean id="configurationFactory" class="org.activiti.osgi.blueprint.ConfigurationFactory">
        <property name="dataSource" ref="dataSource" />
        <property name="databaseSchemaUpdate" value="true" />
    </bean>

    <bean id="configuration" factory-ref="configurationFactory" factory-method="getConfiguration"/>

    <bean id="processEngineFactory"
          class="org.activiti.osgi.blueprint.ProcessEngineFactoryWithELResolver"
          init-method="init"
          destroy-method="destroy">
        <property name="processEngineConfiguration" ref="configuration" />
        <property name="bundle" ref="blueprintBundle" />
        <property name="blueprintELResolver" ref="blueprintELResolver" />
    </bean>

    <bean id="processEngine" factory-ref="processEngineFactory"
          factory-method="getObject" />

    <bean id="runtimeService" factory-ref="processEngine"
          factory-method="getRuntimeService" />
    <bean id="repositoryService" factory-ref="processEngine"
          factory-method="getRepositoryService" />
    <bean id="historyService" factory-ref="processEngine"
          factory-method="getHistoryService" />

    <bean id="routeBuilder" class="de.myproject.jobs.bpmn.BpmnRestRouteBuilder">
        <property name="processEngine" ref="processEngineInstance"/>
        <property name="repositoryService" ref="repositoryServiceInstance"/>
        <property name="runtimeService" ref="runtimeServiceInstance" />
        <property name="historyService" ref="historyServiceInstance" />
    </bean>
    <bean id="activator" class="de.myproject.jobs.bpmn.Activator">
        <property name="processEngine" ref="processEngineInstance" />
    </bean>
    <bean id="jobsBpmnProducer" class="de.myproject.jobs.components.bpmn.JobsBpmnProducer">
        <property name="runtimeService" ref="runtimeServiceInstance" />
        <property name="processEngine" ref="processEngineInstance" />
    </bean>

    <bean id="jobsBpmnEndpoint" class="de.myproject.bpmn.JobsBpmnEndpoint">
        <property name="processEngine" ref="processEngineInstance" />
        <property name="runtimeService" ref="runtimeServiceInstance" />
    </bean>


    <reference id="processEngineInstance" interface="org.activiti.engine.ProcessEngine"/>
    <reference id="historyServiceInstance" interface="org.activiti.engine.HistoryService"/>
    <reference id="runtimeServiceInstance" interface="org.activiti.engine.ProcessEngine"/>
    <reference id="repositoryServiceInstance" interface="org.activiti.engine.ProcessEngine"/>




    <reference-list id="activityProviders" availability="optional"
                    interface="org.activiti.engine.delegate.JavaDelegate"
                    activation="eager">

        <reference-listener ref="blueprintELResolver" bind-method="bindService" unbind-method="unbindService"/>
    </reference-list>

    <bean id="blueprintELResolver" class="org.activiti.osgi.blueprint.BlueprintELResolver" />
    <service ref="processEngineInstance" interface="org.activiti.engine.ProcessEngine" />
    <service ref="runtimeServiceInstance" interface="org.activiti.engine.RuntimeService" />
    <service ref="repositoryServiceInstance" interface="org.activiti.engine.RepositoryService" />
    <service ref="historyServiceInstance" interface="org.activiti.engine.HistoryService" />

</blueprint>



It starts the Bundle and says:



Bundle jobs-bpmn/1.0.0 is waiting for dependencies [(objectClass=org.activiti.engine.ProcessEngine), (objectClass=org.activiti.engine.ProcessEngine), (objectClass=org.activiti.engine.HistoryService), (objectClass=org.activiti.engine.ProcessEngine)]





and gets timeout after some time:

2016-11-01 11:14:31,574 | ERROR | rint Extender: 3 | BlueprintContainerImpl           | 69 - org.apache.aries.blueprint.core - 1.5.0 | Unable to start blueprint container for bundle jobs-bpmn/1.0.0 due to unresolved dependencies [(objectClass=org.activiti.engine.ProcessEngine), (objectClass=org.activiti.engine.ProcessEngine), (objectClass=org.activiti.engine.HistoryService), (objectClass=org.activiti.engine.ProcessEngine)]
java.util.concurrent.TimeoutException
        at org.apache.aries.blueprint.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:359)[69:org.apache.aries.blueprint.core:1.5.0]

due to unresolved dependencies [(objectClass=org.activiti.engine.ProcessEngine), (objectClass=org.activiti.engine.ProcessEngine), (objectClass=org.activiti.engine.HistoryService), (objectClass=org.activiti.engine.ProcessEngine)]



what did i do wrong?


Thanks a lot!

Cheers

Marcel

Outcomes