我按照官方网站上的指南将 camunda.war (7.2) 部署到我的 Vanilla tomcat7 中。

现在,当我启动 tomcat 时,出现以下错误:

GRAVE: Error while closing command context
org.camunda.bpm.engine.ProcessEngineException: historyLevel mismatch: configuration says org.camunda.bpm.engine.impl.history.HistoryLevelAudit@21 and database says 3

在数据库(ACT_GE_PROPERTY 表)中,historyLevel 设置为 3
这是我的 bpm-platform.xml 文件
    <?xml version="1.0" encoding="UTF-8"?>
<bpm-platform xmlns="http://www.camunda.org/schema/1.0/BpmPlatform"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.camunda.org/schema/1.0/BpmPlatform http://www.camunda.org/schema/1.0/BpmPlatform ">

  <job-executor>
    <job-acquisition name="default" />
  </job-executor>

  <process-engine name="default">
    <job-acquisition>default</job-acquisition>
    <configuration>org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration</configuration>
    <datasource>java:jdbc/solve</datasource>

    <properties>
      <property name="history">full</property>
      <property name="databaseSchemaUpdate">true</property>
      <property name="authorizationEnabled">true</property>
      <property name="jobExecutorDeploymentAware">true</property>
    </properties>


    <plugins>

    <!-- plugin enabling Process Application event listener support -->
        <plugin>
           <class>org.camunda.bpm.application.impl.event.ProcessApplicationEventListenerPlugin</class>
        </plugin>

    <!-- plugin enabling integration of camunda Spin -->
        <plugin>
           <class>org.camunda.spin.plugin.impl.SpinProcessEnginePlugin</class>
        </plugin>

        <!-- plugin enabling connect support -->
        <plugin>
           <class>org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin</class>
        </plugin>
    </plugins>

  </process-engine>

</bpm-platform>

编辑

进程.xml
    <?xml version="1.0" encoding="UTF-8" ?>
<process-application
     xmlns="http://www.camunda.org/schema/1.0/ProcessApplication"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <process-archive name="MyProcess">
    <process-engine>myEngine</process-engine>
    <properties>
      <property name="isDeleteUponUndeploy">false</property>
      <property name="isScanForProcessDefinitions">true</property>
    </properties>
  </process-archive>

</process-application>

应用上下文.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jee="http://www.springframework.org/schema/jee"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
       http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd">


    <jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/my_process" />

    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource" />
    </bean>

    <bean id="processEngineConfiguration" class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
        <property name="processEngineName" value="myEngine" />
        <property name="dataSource" ref="dataSource" />
        <property name="transactionManager" ref="transactionManager" />
        <property name="databaseSchemaUpdate" value="true" />
        <property name="jobExecutorActivate" value="false" />
        <property name="deploymentResources" value="classpath*:*.bpmn" />
        <property name="processEnginePlugins">
            <list>
              <bean id="spinPlugin" class="org.camunda.spin.plugin.impl.SpinProcessEnginePlugin" />
            </list>
        </property>
    </bean>

    <bean id="processEngine" class="org.camunda.bpm.engine.spring.container.ManagedProcessEngineFactoryBean" destroy-method="destroy">
        <property name="processEngineConfiguration" ref="processEngineConfiguration" />
    </bean>

    <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
    <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
    <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
    <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
    <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />

    <bean id="MyProcess" class="org.camunda.bpm.engine.spring.application.SpringServletProcessApplication" />

    <context:annotation-config />

    <bean class="it.processes.Starter" />
    <bean id="cudOnProcessVariableService" class="it.services.CUDonProcessVariableService" />

</beans>

最佳答案

您是否从 camunda.org/download 下载了 Tomcat 的“camunda standalone webapp” WAR ?

如果是这样,您应该通过将 <property name="history" value="full"/> 添加到流程引擎配置 bean <bean id="processEngineConfiguration" class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration> 来调整“application-context.xml”文件中的历史记录级别。

否则很奇怪,您将 camunda.war 安装到 vanilla Tomcat,但发布了对 bpm-platform.xml 文件的引用,当您不使用共享流程引擎方法时,该文件根本不使用。

关于camunda - Camunda 7.2 上的历史级别不匹配,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/29603620/

10-11 12:17