AnsweredAssumed Answered

Is the Activiti QuickStart example not working or out of date

Question asked by matykiewicz on Jan 25, 2017
Latest reply on Jan 31, 2017 by thuynh

I am working through the QuickStart guide (Quick Start Guide | Activiti.org )and I get a runtime error. I did not see any issue in Jira. I thought I'd ask if someone can spot the error or give me a better quickstart. Here most of the info:

 

The error (more detail below):

Exception in thread "main" org.activiti.engine.ActivitiException: Error while building ibatis SqlSessionFactory: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Unknown element <bind> in SQL statement.

 

My setup:

Linux Mint 18, Oracle JDK1.8.0

Activiti 5.22.0

 

Here's the pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.activiti</groupId>
<artifactId>ActivitiDeveloperQuickStart</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>ActivitiDeveloperQuickStart</name>
<url>http://maven.apache.org</url>


<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
<version>5.22.0</version>
</dependency>

<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-image-generator</artifactId>
<version>5.22.0</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-bpmn-converter</artifactId>
<version>5.22.0</version>
</dependency>

<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring</artifactId>
<version>5.22.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.21</version>
</dependency>

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.193</version>
</dependency>

<dependency>
<groupId>org.apache.ibatis</groupId>
<artifactId>ibatis-core</artifactId>
<version>3.0</version>
</dependency>
<!--
<dependency>
<groupId>org.apache.ibatis</groupId>
<artifactId>ibatis-sqlmap</artifactId>
<version>3.0-beta-10</version>
</dependency>
-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.5</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.7</version>
</dependency>

</dependencies>


<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>

<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.example.OnboardingRequest</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>

</plugin>
</plugins>

</build>

</project>

 

I used the example source and log4j. properties from the QuickStart page, and here's the main class to be sure:

 

package com.example;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;
import org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration;

public class OnboardingRequest {

public static void main(String[] args) {
ProcessEngineConfiguration cfg = new StandaloneProcessEngineConfiguration()
.setJdbcUrl("jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000")
.setJdbcUsername("sa")
.setJdbcPassword("")
.setJdbcDriver("org.h2.Driver")
.setDatabaseSchema(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);

ProcessEngine processEngine = cfg.buildProcessEngine();
String pName = processEngine.getName();
String ver = processEngine.VERSION;

System.out.println("ProcessEngine ["+pName+"] Version: ["+ver+"]");

}

}

 

The project compiles and packages fine, and adding the dependencies fixed all the NoClassFound Exceptions. Here's the full runtime error:

 

-------
 /scratch/java/activiti/ActivitiDeveloperQuickStart $ $JAVA_HOME/bin/java -jar ./target/ActivitiDeveloperQuickStart-1.0-SNAPSHOT-jar-with-dependencies.jar
02:51:45,438 [main] DEBUG org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl - initializing datasource to db: jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000
02:51:45,461 [main] DEBUG org.apache.ibatis.datasource.pooled.PooledDataSource - PooledDataSource forcefully closed/removed all connections.
02:51:45,957 [main] DEBUG org.apache.ibatis.datasource.pooled.PooledDataSource - Created connection 1898220577.
02:51:45,968 [main] DEBUG org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl - database product name: 'H2'
02:51:45,977 [main] DEBUG org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl - using database type: h2
02:51:45,978 [main] DEBUG org.apache.ibatis.datasource.pooled.PooledDataSource - Returned connection 1898220577 to pool.
Exception in thread "main" org.activiti.engine.ActivitiException: Error while building ibatis SqlSessionFactory: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Unknown element <bind> in SQL statement.
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:922)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:642)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:612)
at com.example.OnboardingRequest.main(OnboardingRequest.java:17)
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Unknown element <bind> in SQL statement.
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:71)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:55)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.parseMybatisConfiguration(ProcessEngineConfigurationImpl.java:954)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initMybatisConfiguration(ProcessEngineConfigurationImpl.java:937)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:918)
... 3 more
Caused by: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Unknown element <bind> in SQL statement.
at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:59)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:39)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:247)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:69)
... 7 more
Caused by: org.apache.ibatis.builder.BuilderException: Unknown element <bind> in SQL statement.
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseDynamicTags(XMLStatementBuilder.java:88)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.access$1100(XMLStatementBuilder.java:22)
at org.apache.ibatis.builder.xml.XMLStatementBuilder$IfHandler.handleNode(XMLStatementBuilder.java:223)
at org.apache.ibatis.builder.xml.XMLStatementBuilder$ChooseHandler.handleWhenOtherwiseNodes(XMLStatementBuilder.java:255)
at org.apache.ibatis.builder.xml.XMLStatementBuilder$ChooseHandler.handleNode(XMLStatementBuilder.java:243)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseDynamicTags(XMLStatementBuilder.java:90)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.access$1100(XMLStatementBuilder.java:22)
at org.apache.ibatis.builder.xml.XMLStatementBuilder$TrimHandler.handleNode(XMLStatementBuilder.java:177)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseDynamicTags(XMLStatementBuilder.java:90)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.access$1100(XMLStatementBuilder.java:22)
at org.apache.ibatis.builder.xml.XMLStatementBuilder$ForEachHandler.handleNode(XMLStatementBuilder.java:208)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseDynamicTags(XMLStatementBuilder.java:90)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.access$1100(XMLStatementBuilder.java:22)
at org.apache.ibatis.builder.xml.XMLStatementBuilder$TrimHandler.handleNode(XMLStatementBuilder.java:177)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseDynamicTags(XMLStatementBuilder.java:90)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.access$1100(XMLStatementBuilder.java:22)
at org.apache.ibatis.builder.xml.XMLStatementBuilder$ForEachHandler.handleNode(XMLStatementBuilder.java:208)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseDynamicTags(XMLStatementBuilder.java:90)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.access$1100(XMLStatementBuilder.java:22)
at org.apache.ibatis.builder.xml.XMLStatementBuilder$WhereHandler.handleNode(XMLStatementBuilder.java:190)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseDynamicTags(XMLStatementBuilder.java:90)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.access$1100(XMLStatementBuilder.java:22)
at org.apache.ibatis.builder.xml.XMLStatementBuilder$IncludeNodeHandler.contents(XMLStatementBuilder.java:171)
at org.apache.ibatis.builder.xml.XMLStatementBuilder$IncludeNodeHandler.handleNode(XMLStatementBuilder.java:166)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseDynamicTags(XMLStatementBuilder.java:90)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.access$1100(XMLStatementBuilder.java:22)
at org.apache.ibatis.builder.xml.XMLStatementBuilder$IncludeNodeHandler.contents(XMLStatementBuilder.java:171)
at org.apache.ibatis.builder.xml.XMLStatementBuilder$IncludeNodeHandler.handleNode(XMLStatementBuilder.java:166)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseDynamicTags(XMLStatementBuilder.java:90)
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:48)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:192)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:57)
... 10 more

 

 

Thanks in advance.

James

Outcomes