Spring Boot 2.0.M6 + Kotlin

Hey guys,

Is there someone who can tell me if camunda springboot starter works with springboot 2.0.M6 and kotlin? I’m trying to make it work, but I cant get passed this problem:

Caused by: java.lang.NoClassDefFoundError: org/glassfish/jersey/server/spi/Container

I was thinking maybe this is a problem related to the embedded server, and if I were to change it to use something else, like Jetty, it could work… but I wanted an opinion first before wasting more time in this problem. I’ll downgrade the springboot version for now and use the 1.5.8-RELEASE until I find more information about this.

I’ll leave the pom.xml here for analysis.

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>com.example</groupId>
	<artifactId>demo</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>

	<name>demo</name>
	<description>Demo project for Spring Boot</description>

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.0.0.M6</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>

	<properties>
		<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<java.version>1.8</java.version>
        <camunda.spring.boot.version>2.2.0</camunda.spring.boot.version>
        <camunda.engine.version>7.7.0</camunda.engine.version>
        <camunda.version>7.8.0-alpha4</camunda.version>
        <spring-boot.version>2.0.0.M6</spring-boot.version>
	</properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <!-- Import dependency management from camunda -->
                <groupId>org.camunda.bpm</groupId>
                <artifactId>camunda-bom</artifactId>
                <version>${camunda.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

            <dependency>
                <!-- Import dependency management from Spring Boot -->
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

        </dependencies>
    </dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jetbrains.kotlin</groupId>
			<artifactId>kotlin-stdlib-jre8</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jetbrains.kotlin</groupId>
			<artifactId>kotlin-reflect</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

        <!--workflow-->
        <dependency>
            <groupId>org.camunda.bpm.extension.springboot</groupId>
            <artifactId>camunda-bpm-spring-boot-starter</artifactId>
            <version>${camunda.spring.boot.version}</version>
        </dependency>
        <dependency>
            <groupId>org.camunda.bpm.extension.springboot</groupId>
            <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
            <version>${camunda.spring.boot.version}</version>
        </dependency>
        <dependency>
            <groupId>org.camunda.bpm.extension.springboot</groupId>
            <artifactId>camunda-bpm-spring-boot-starter-test</artifactId>
            <version>${camunda.spring.boot.version}</version>
        </dependency>

        <dependency>
            <groupId>org.camunda.bpm.extension</groupId>
            <artifactId>camunda-bpm-assert-scenario</artifactId>
            <version>0.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.camunda.bpm</groupId>
            <artifactId>camunda-engine</artifactId>
            <version>${camunda.engine.version}</version>
        </dependency>
	</dependencies>

	<build>
		<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
		<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>kotlin-maven-plugin</artifactId>
				<groupId>org.jetbrains.kotlin</groupId>
				<configuration>
					<compilerPlugins>
						<plugin>spring</plugin>
					</compilerPlugins>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.jetbrains.kotlin</groupId>
						<artifactId>kotlin-maven-allopen</artifactId>
						<version>${kotlin.version}</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>

	<repositories>
		<repository>
			<id>spring-snapshots</id>
			<name>Spring Snapshots</name>
			<url>https://repo.spring.io/snapshot</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
		<repository>
			<id>spring-milestones</id>
			<name>Spring Milestones</name>
			<url>https://repo.spring.io/milestone</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories>

	<pluginRepositories>
		<pluginRepository>
			<id>spring-snapshots</id>
			<name>Spring Snapshots</name>
			<url>https://repo.spring.io/snapshot</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</pluginRepository>
		<pluginRepository>
			<id>spring-milestones</id>
			<name>Spring Milestones</name>
			<url>https://repo.spring.io/milestone</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</pluginRepository>
	</pluginRepositories>


</project>

Right now, we do not have any experience with Spring Boot 2 and the starter, we will start investigating after the 7.8 Release.

Hi,

Is there any news about Kotlin?

I built an example using 2.0.0.M7, kotlin 1.2.10 and latest camunda starter (2.3.0) … no problems encountered, check out: https://github.com/holunda-io/camunda-springboot-kotlin

1 Like