Apache camel Activiti OSGI和Blueprint的问题

Apache camel Activiti OSGI和Blueprint的问题,apache-camel,osgi,activiti,apache-karaf,blueprint-osgi,Apache Camel,Osgi,Activiti,Apache Karaf,Blueprint Osgi,我尝试在KARAF OSGI中使用Activiti和camel 我从服务组合配置中复制了一些部分 <?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.apac

我尝试在KARAF OSGI中使用Activiti和camel

我从服务组合配置中复制了一些部分

<?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"
       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"
       xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">

<ext:property-placeholder />

<!--
  Setting up the process engine configuration, using an embedded H2 database together with our default Aries
  transaction manager.
-->
<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>

<reference id="transactionManager" interface="javax.transaction.TransactionManager"/>

<bean id="configuration" class="org.activiti.engine.impl.cfg.JtaProcessEngineConfiguration" ext:field-injection="true">
    <property name="databaseType" value="h2"/>
    <property name="dataSource" ref="dataSource"/>
    <property name="transactionManager" ref="transactionManager"/>
    <property name="databaseSchemaUpdate" value="true"/>
    <property name="transactionsExternallyManaged" value="true" />
    <property name="defaultCamelContext" value="defaultContext"/>
</bean>

<!--
  Set up the custom resolver implementation to ease integration with Camel routes
-->
<bean id="resolver" class="de.myproject.CamelAwareELResolver"/>

<reference-list availability="optional" interface="org.activiti.camel.ContextProvider">
    <reference-listener ref="resolver" bind-method="addContextProvider" unbind-method="removeContextProvider" />
</reference-list>

<reference-list availability="optional" interface="org.activiti.engine.delegate.JavaDelegate">
    <reference-listener ref="resolver" bind-method="bindService" unbind-method="unbindService" />
</reference-list>

<!--
  Set up the Activiti process engine itself
-->
<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="resolver" />
</bean>

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

<bean id="runtimeService" factory-ref="processEngine" factory-method="getRuntimeService" />

<!--
  Register the ProcessEngine and RuntimeService as OSGi services to allow other bundles to use them
-->
<service ref="processEngine" interface="org.activiti.engine.ProcessEngine"/>
<service ref="runtimeService" interface="org.activiti.engine.RuntimeService"/>


<bean id="routeBuilder" class="de.myproject.bpmn.BpmnRestRouteBuilder"/>

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

我可以在容器中毫无问题地部署捆绑包。当我使用camel模块触发工作流时,会出现以下异常:

2016-11-08 11:56:43569 | ERROR | m://client_queue | JobsBpmnProducer |45-作业日志记录-1.0.0 |找不到与此相关的Processdefinition 标识符ActivityException:应为 Activiti Camel模块的SpringProcessEngine配置。
ClassCastException: org.activiti.engine.impl.cfg.JtaProcessEngineConfiguration不能为空 转换为org.activiti.spring.SpringProcessEngineConfiguration**


如何使用spring部署符合OSGI的Processengine以使Camel正常工作?

此问题可能已在活动代码中得到解决。 看


您能试用最新的Activitiy版本吗?

此问题可能已在活动代码中得到解决。 看


您能试用最新的Activitiy版本吗?

解决方案包含的任何理想版本?我使用5.19.0.45.19.0在问题解决后发布。所以你的版本可能会包括它。我仍然会给最新版本一个旋转来检查。看看Activiti代码,这个问题没有解决,@ChristianSchneider提到的pr确实解决了一个ClassCastException,但不是这个。。查看代码[1],CamelBehavior总是期望SpringProcessEngineConfiguration(第197行)。1:Hey@Brampouwels这告诉我在OSGI上下文中不可能使用Camel?@MarcelWolf认为你是对的,这是不可能的,Activiti文档[1]也提到了Spring依赖性。1:解决方案包括哪些理想版本?我使用5.19.0.45.19.0在问题解决后发布。所以你的版本可能会包括它。我仍然会给最新版本一个旋转来检查。看看Activiti代码,这个问题没有解决,@ChristianSchneider提到的pr确实解决了一个ClassCastException,但不是这个。。查看代码[1],CamelBehavior总是期望SpringProcessEngineConfiguration(第197行)。1:Hey@Brampouwels这告诉我在OSGI上下文中不可能使用Camel?@MarcelWolf认为你是对的,这是不可能的,Activiti文档[1]也提到了Spring依赖性。1: