javacamundasaxparseexception

Camunda - why is process engine not getting created?


I am trying to integrate the BPMN tool : camunda in my app . I have been using the camunda docs here : https://docs.camunda.org/stable/guides/getting-started-guides/spring-framework/#set-up/application-context for that purpose .

I have added the application context related information as it has been mentioned in there :

    <bean id="dataSource" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
      <property name="targetDataSource">
        <bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
          <property name="driverClass" value="org.h2.Driver" />
          <property name="url"
                    value="jdbc:h2:mem:process-engine;DB_CLOSE_DELAY=1000" />
          <property name="username" value="sa" />
          <property name="password" value="" />
        </bean>
      </property>
    </bean>

    <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="engine" />
      <property name="dataSource" ref="dataSource" />
      <property name="transactionManager" ref="transactionManager" />
      <property name="databaseSchemaUpdate" value="true" />
      <property name="jobExecutorActivate" value="false" />
    </bean>

    <bean id="processEngine" class="org.camunda.bpm.engine.spring.ProcessEngineFactoryBean">
      <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" />

But during build I am getting this error :

    Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is org.camunda.bpm.engine.ProcessEngineException: Error while building ibatis SqlSessionFactory: Cause: org.xml.sax.SAXParseException; lineNumber: 95; columnNumber: 12; The content of element type "if" must match "(include|trim|where|set|foreach|choose|if)".
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175) ~[spring-beans.jar:4.3.4.RELEASE]
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103) ~[spring-beans.jar:4.3.4.RELEASE]

Can someone please let me know what mistake I am making here ? Any help will be greatly appreciated .


Solution

  • Camunda 7.3.0 uses mybatis 3.2.8 as per the project BOM.

    You are using mybatis 3.2.2 which possibly causes a dependency version mismatch. Try updating your project mybatis dependencies to match the ones in your Camunda version.