Deploying BPM from Modeler to Camunda running in a Spring Boot application and MySql

Following along with the quick start guide and the payment.bpmn, I’m able to use the modeler to deploy the bpmn to Camunda running in a docker container, but I cannot deploy to Camunda running in a Spring app connected to MySql. The modeler says it deploys, but then I don’t see it in the Cockpit. Also, if I put the payment.bpmn in src/main/resources, at startup I get:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.camunda.bpm.engine.spring.SpringProcessEngineServicesConfiguration’: Unsatisfied dependency expressed through field ‘processEngine’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘processEngineFactoryBean’: FactoryBean threw exception on object creation; nested exception is org.camunda.bpm.engine.ProcessEngineException: ENGINE-03083 Exception while executing Batch Database Operations with message ’

Error flushing statements. Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ResourceEntity.insertResource (batch index #3) failed. 2 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Unknown column ‘TYPE_’ in ‘field list’

Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ResourceEntity.insertResource (batch index #3) failed. 2 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Unknown column ‘TYPE_’ in ‘field list’

java.sql.BatchUpdateException: Unknown column ‘TYPE_’ in ‘field list’
java.sql.SQLSyntaxErrorException: Unknown column ‘TYPE_’ in ‘field list’
'. Flush summary:
[
INSERT JobDefinitionEntity[7fe07843-535a-11e9-a7a2-1e88ea6bfc63]
INSERT JobDefinitionEntity[7fe07844-535a-11e9-a7a2-1e88ea6bfc63]
INSERT DeploymentEntity[7fcca220-535a-11e9-a7a2-1e88ea6bfc63]
INSERT ResourceEntity[7fccc931-535a-11e9-a7a2-1e88ea6bfc63]
INSERT ProcessDefinitionEntity[order:1:7fe07842-535a-11e9-a7a2-1e88ea6bfc63]
]

build.gradle file:

plugins {
id ‘org.springframework.boot’ version ‘2.1.3.RELEASE’
id ‘java’
}

apply plugin: ‘io.spring.dependency-management’

group = ‘com.pgi’
version = ‘0.0.1-SNAPSHOT’
sourceCompatibility = ‘1.8’

repositories {
mavenCentral()
}

dependencies {
implementation ‘org.springframework.boot:spring-boot-starter’
implementation ‘org.springframework.boot:spring-boot-starter-jdbc’
implementation ‘org.springframework.boot:spring-boot-starter-web’
implementation ‘org.camunda.bpm.springboot:camunda-bpm-spring-boot-starter-webapp:3.2.0’
implementation ‘org.camunda.bpm.springboot:camunda-bpm-spring-boot-starter:3.2.0’

implementation ‘mysql:mysql-connector-java’
// implementation ‘com.h2database:h2’

testImplementation ‘org.springframework.boot:spring-boot-starter-test’
}

application.properties

server.port=8080

spring.datasource.url=jdbc:mysql://127.0.0.1:3306/camunda?characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.username=camunda
spring.datasource.password=camunda

spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=create
camunda.bpm.database.type=mysql

If i connect to the H2 in memory DB, then the bpmn loads fine, but I still can’t deploy through the modeler.

I updated the DB from 7.9 to 7.10 and now process definitions load at start up, but I can still not deploy from the modeler. Again, I can deploy from the modeler if I run Camunda using the Docker method described in the startup docs but not from the spring boot instance.

I added the org.camunda.bpm.springboot:camunda-bpm-spring-boot-starter-rest:3.2.0 dependency, but still can’t deploy from the modeler.

What rest call are you using exactly.

I’m hitting the deploy button in the modeler. So whatever call the modeler makes.

The default deployment rest call in the modeler is not the same as the one required for spring boot.
You need to change the configuration from
http://localhost:8080/engine-rest/deployment/create
to
http://localhost:8080/rest/deployment/create