Error when starting the Springboot examples

I am trying out the Springboot examples in the 6.3.1 documentation. In the pom I have just only included the flowable-spring-boot-starter artifact. The program only runs issues SpringApplication.run

But when I start my application with Oracle JDK 1.8.144 I get the following error stack trace:

00:21:00.349 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.NoClassDefFoundError: org/springframework/core/ErrorCoded
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    ...
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.springframework.boot.context.properties.bind.BindConverter$TypeConverterConversionService.createTypeConverter(BindConverter.java:182)
	at org.springframework.boot.context.properties.bind.BindConverter$TypeConverterConversionService.<init>(BindConverter.java:176)
	at org.springframework.boot.context.properties.bind.BindConverter.getConversionServices(BindConverter.java:73)
	at org.springframework.boot.context.properties.bind.BindConverter.<init>(BindConverter.java:64)
	at org.springframework.boot.context.properties.bind.Binder$Context.<init>(Binder.java:399)
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:209)
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:166)
	at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:153)
	at org.springframework.boot.context.config.AnsiOutputApplicationListener.onApplicationEvent(AnsiOutputApplicationListener.java:43)
    ...
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:317)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243)
	at ab.cd.flowboot.App.main(App.java:14)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.ErrorCoded
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 57 common frames omitted

In my pom.xml I have

<properties>
    <flowable.version>6.3.1</flowable.version>
</properties>
<dependencies>
<dependency>
    <groupId>org.flowable</groupId>
    <artifactId>flowable-spring-boot-starter</artifactId>
    <version>${flowable.version}</version>
</dependency>

My code does not do anything other that start the program

@SpringBootApplication
public class App {
    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }
}

I start the application with Oracle JDK 1.8.144

Which Spring Boot version are you using?

It seems like there is a mix of Spring 4 and Spring 5 in there.

Can you also give us the output of mvn dependency:tree please?

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building flowboot 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ flowboot ---
[INFO] ab.cd:flowboot:jar:1.0-SNAPSHOT
[INFO] \- org.flowable:flowable-spring-boot-starter:jar:6.3.1:compile
[INFO]    +- org.flowable:flowable-spring-boot-autoconfigure:jar:6.3.1:compile
[INFO]    +- org.flowable:flowable-spring-boot-starter-app:jar:6.3.1:compile
[INFO]    |  +- org.flowable:flowable-app-engine:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-app-engine-api:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-engine-common-api:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-idm-engine:jar:6.3.1:compile
[INFO]    |  |  |  \- commons-codec:commons-codec:jar:1.11:compile
[INFO]    |  |  +- org.flowable:flowable-variable-service:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-identitylink-service:jar:6.3.1:compile
[INFO]    |  |  |  \- org.flowable:flowable-identitylink-service-api:jar:6.3.1:compile
[INFO]    |  |  +- org.liquibase:liquibase-core:jar:3.6.1:compile
[INFO]    |  |  +- com.fasterxml.uuid:java-uuid-generator:jar:3.1.5:compile
[INFO]    |  |  +- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO]    |  |  +- org.apache.commons:commons-lang3:jar:3.7:compile
[INFO]    |  |  \- org.flowable:flowable-dmn-api:jar:6.3.1:compile
[INFO]    |  \- org.flowable:flowable-app-engine-spring:jar:6.3.1:compile
[INFO]    |     +- org.springframework:spring-context:jar:4.3.14.RELEASE:compile
[INFO]    |     |  +- org.springframework:spring-aop:jar:4.3.14.RELEASE:compile
[INFO]    |     |  \- org.springframework:spring-expression:jar:4.3.14.RELEASE:compile
[INFO]    |     +- org.springframework:spring-tx:jar:4.3.14.RELEASE:compile
[INFO]    |     \- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
[INFO]    +- org.flowable:flowable-spring-boot-starter-process:jar:6.3.1:compile
[INFO]    |  +- org.flowable:flowable-engine:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-bpmn-converter:jar:6.3.1:compile
[INFO]    |  |  |  \- org.flowable:flowable-bpmn-model:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-process-validation:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-image-generator:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-task-service:jar:6.3.1:compile
[INFO]    |  |  |  \- org.flowable:flowable-task-service-api:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-job-service:jar:6.3.1:compile
[INFO]    |  |  |  \- org.flowable:flowable-job-service-api:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-idm-api:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-cmmn-api:jar:6.3.1:compile
[INFO]    |  |  |  \- org.flowable:flowable-cmmn-model:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-form-model:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-form-api:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-content-api:jar:6.3.1:compile
[INFO]    |  |  +- org.apache.commons:commons-email:jar:1.5:compile
[INFO]    |  |  |  \- com.sun.mail:javax.mail:jar:1.5.6:compile
[INFO]    |  |  |     \- javax.activation:activation:jar:1.1:compile
[INFO]    |  |  +- org.mybatis:mybatis:jar:3.4.5:compile
[INFO]    |  |  +- org.springframework:spring-beans:jar:4.3.14.RELEASE:compile
[INFO]    |  |  \- joda-time:joda-time:jar:2.9.9:compile
[INFO]    |  \- org.flowable:flowable-spring:jar:6.3.1:compile
[INFO]    |     +- org.flowable:flowable-job-spring-service:jar:6.3.1:compile
[INFO]    |     \- org.springframework:spring-orm:jar:4.3.14.RELEASE:compile
[INFO]    +- org.flowable:flowable-spring-boot-starter-cmmn:jar:6.3.1:compile
[INFO]    |  +- org.flowable:flowable-cmmn-engine:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-cmmn-image-generator:jar:6.3.1:compile
[INFO]    |  |  \- org.flowable:flowable-cmmn-converter:jar:6.3.1:compile
[INFO]    |  \- org.flowable:flowable-cmmn-spring:jar:6.3.1:compile
[INFO]    +- org.flowable:flowable-spring-boot-starter-dmn:jar:6.3.1:compile
[INFO]    |  +- org.flowable:flowable-dmn-engine:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-dmn-model:jar:6.3.1:compile
[INFO]    |  |  +- org.flowable:flowable-dmn-xml-converter:jar:6.3.1:compile
[INFO]    |  |  +- commons-io:commons-io:jar:2.6:compile
[INFO]    |  |  \- commons-logging:commons-logging:jar:1.2:compile
[INFO]    |  \- org.flowable:flowable-dmn-spring:jar:6.3.1:compile
[INFO]    +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.0.2.RELEASE:compile
[INFO]    |  +- org.springframework.boot:spring-boot-starter:jar:2.0.2.RELEASE:compile
[INFO]    |  |  +- org.springframework.boot:spring-boot:jar:2.0.2.RELEASE:compile
[INFO]    |  |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.0.2.RELEASE:compile
[INFO]    |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.0.2.RELEASE:compile
[INFO]    |  |  |  +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO]    |  |  |  |  \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO]    |  |  |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.10.0:compile
[INFO]    |  |  |  |  \- org.apache.logging.log4j:log4j-api:jar:2.10.0:compile
[INFO]    |  |  |  \- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO]    |  |  +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO]    |  |  +- org.springframework:spring-core:jar:5.0.6.RELEASE:compile
[INFO]    |  |  |  \- org.springframework:spring-jcl:jar:5.0.6.RELEASE:compile
[INFO]    |  |  \- org.yaml:snakeyaml:jar:1.19:compile
[INFO]    |  +- com.zaxxer:HikariCP:jar:2.7.9:compile
[INFO]    |  \- org.springframework:spring-jdbc:jar:5.0.6.RELEASE:compile
[INFO]    +- org.flowable:flowable-spring-configurator:jar:6.3.1:compile
[INFO]    |  \- org.flowable:flowable-engine-configurator:jar:6.3.1:compile
[INFO]    +- org.flowable:flowable-cmmn-spring-configurator:jar:6.3.1:compile
[INFO]    |  \- org.flowable:flowable-cmmn-engine-configurator:jar:6.3.1:compile
[INFO]    +- org.flowable:flowable-dmn-spring-configurator:jar:6.3.1:compile
[INFO]    |  \- org.flowable:flowable-dmn-engine-configurator:jar:6.3.1:compile
[INFO]    +- org.flowable:flowable-form-spring-configurator:jar:6.3.1:compile
[INFO]    |  +- org.flowable:flowable-form-spring:jar:6.3.1:compile
[INFO]    |  |  \- org.flowable:flowable-form-engine:jar:6.3.1:compile
[INFO]    |  |     \- org.flowable:flowable-form-json-converter:jar:6.3.1:compile
[INFO]    |  \- org.flowable:flowable-form-engine-configurator:jar:6.3.1:compile
[INFO]    +- org.flowable:flowable-content-spring-configurator:jar:6.3.1:compile
[INFO]    |  +- org.flowable:flowable-content-spring:jar:6.3.1:compile
[INFO]    |  |  \- org.flowable:flowable-content-engine:jar:6.3.1:compile
[INFO]    |  \- org.flowable:flowable-content-engine-configurator:jar:6.3.1:compile
[INFO]    \- org.flowable:flowable-idm-spring-configurator:jar:6.3.1:compile
[INFO]       +- org.flowable:flowable-engine-common:jar:6.3.1:compile
[INFO]       |  +- org.flowable:flowable-variable-service-api:jar:6.3.1:compile
[INFO]       |  +- com.fasterxml.jackson.core:jackson-core:jar:2.8.11:compile
[INFO]       |  \- com.fasterxml.jackson.core:jackson-databind:jar:2.8.11.1:compile
[INFO]       |     \- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
[INFO]       +- org.flowable:flowable-spring-common:jar:6.3.1:compile
[INFO]       +- org.flowable:flowable-idm-spring:jar:6.3.1:compile
[INFO]       \- org.flowable:flowable-idm-engine-configurator:jar:6.3.1:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.126 s
[INFO] Finished at: 2018-07-10T17:25:40+01:00
[INFO] Final Memory: 22M/489M
[INFO] ------------------------------------------------------------------------

Seems that there is some leak of Spring 4. Can you please show us your entire pom.xml? I think that if you add the spring boot as a parent the problem will go away

I gave no parent in the pom. Which spring boot verion should I add?
.

You should add the latest Spring Boot (2.0.3.RELEASE)

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

You can have a look at this example.

Thank you. That worked.

But maybe the documentation could be clearer in section 5.7.2 where it says about adding the flowable-spring-boot-starter artifact to the pom:

That’s all that’s needed. This dependency will transitively add the correct Flowable and Spring dependencies to the classpath. You can now write the Spring Boot application:

You are right, maybe we need to make that part a bit more clearer. Currently it assumes that a person know about Spring Boot and it’s conventions (to use a parent from Spring Boot) and adding the starter is adding to what start.spring.io would generate.

If you are up for it you could provide a PR (Pull Request) with a clarification that would make the most sense to you. We would gladly accept it

Thank you.

I have created a PR

That’s great. We’ve merged your PR already. Thanks for the contribution. Yiu are right it’s much clearer now :grinning:

Hi Filiphr,

i am facing the similar issue but not ale to find the solution,i am attaching the pom file below

<?xml version="1.0" encoding="UTF-8"?>


4.0.0

org.springframework.boot
spring-boot-starter-parent
2.2.4.RELEASE


com.concordia.ece.se
TwitterClient
0.0.1-SNAPSHOT
TwitterClient
TwitterClient using Spring Boot

<properties>
	<java.version>1.8</java.version>
	<vaadin.version>14.1.16</vaadin.version>
</properties>

<dependencies>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-jersey</artifactId>
	</dependency>
	<dependency>
    <groupId>org.springframework.social</groupId>
    <artifactId>spring-social-core</artifactId>
    <version>1.1.6.RELEASE</version>
</dependency>
	<dependency>
	<groupId>org.springframework.social</groupId>
 	<artifactId>spring-social-twitter</artifactId>
	<version>1.1.0.RELEASE</version>
	</dependency>
	<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>1.4.7.RELEASE</version>
org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-web-services org.springframework.boot spring-boot-starter-webflux com.vaadin vaadin-spring-boot-starter
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-test</artifactId>
		<scope>test</scope>
		<exclusions>
			<exclusion>
				<groupId>org.junit.vintage</groupId>
				<artifactId>junit-vintage-engine</artifactId>
			</exclusion>
		</exclusions>
	</dependency>
	<dependency>
		<groupId>io.projectreactor</groupId>
		<artifactId>reactor-test</artifactId>
		<scope>test</scope>
	</dependency>
</dependencies>

<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-bom</artifactId>
			<version>${vaadin.version}</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>

<build>
	<plugins>
		<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
		</plugin>
		<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
    <execution>
        <id>copy-dependencies</id>
        <phase>prepare-package</phase>
        <goals>
            <goal>copy-dependencies</goal>
        </goals>
        <configuration>
            <outputDirectory>${project.build.directory}/lib</outputDirectory>
            <overWriteReleases>false</overWriteReleases>
            <overWriteSnapshots>false</overWriteSnapshots>
            <overWriteIfNewer>true</overWriteIfNewer>
        </configuration>
    </execution>
</executions>
org.apache.maven.plugins maven-jar-plugin true lib/ theMainClass

And i am getting this error :slight_smile:

java.lang.NoClassDefFoundError: org/springframework/boot/bind/RelaxedDataBinder
at org.springframework.boot.autoconfigure.EnableAutoConfigurationImportSelector.getExcludeAutoConfigurationsProperty(EnableAutoConfigurationImportSelector.java:179) ~[spring-boot-autoconfigure-1.4.7.RELEASE.jar:1.4.7.RELEASE]
at org.springframework.boot.autoconfigure.EnableAutoConfigurationImportSelector.getExclusions(EnableAutoConfigurationImportSelector.java:172) ~[spring-boot-autoconfigure-1.4.7.RELEASE.jar:1.4.7.RELEASE]
at org.springframework.boot.autoconfigure.EnableAutoConfigurationImportSelector.selectImports(EnableAutoConfigurationImportSelector.java:87) ~[spring-boot-autoconfigure-1.4.7.RELEASE.jar:1.4.7.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser$DefaultDeferredImportSelectorGroup.process(ConfigurationClassParser.java:844) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGrouping.getImports(ConfigurationClassParser.java:830) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:563) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:188) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:316) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:233) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) ~[spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE]
at com.concordia.ece.se.TwitterClientApplication.main(TwitterClientApplication.java:10) ~[classes/:na]
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.bind.RelaxedDataBinder
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
… 20 common frames omitted

Can you please help on these

@raja27ravi,

It looks like you are trying to use spring boot auto configure version 1.4.7 with spring boot 2.2.4