Dependency missing when using camunda-spin-dataformat-json-jackson (SPIN)

I tried to configure my application (with embedded Camunda) to use Camunda with JSON as the default serialization format (using the SPIN plugin). I followed the steps described in the Configuring Spin Integration documentation.

Therefore I added the artifacts camunda-spin-core, camunda-spin-dataformat-json-jackson and camunda-engine-plugin-spin to my dependencies. As I understood these should be all additional dependencies I need.

Unfortunately I run into the following exception

Caused by: java.lang.ClassNotFoundException: com.jayway.jsonpath.spi.JsonProvider
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_91]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_91]
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[?:1.8.0_91]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_91]
    at org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormatProvider.createInstance(JacksonJsonDataFormatProvider.java:37) ~[camunda-spin-dataformat-json-jackson-1.3.0.jar:1.3.0]
    at org.camunda.spin.DataFormats.registerProvider(DataFormats.java:152) ~[camunda-spin-core-1.3.0.jar:1.3.0]

I assume that a dependency is missing. If I replace camunda-spin-dataformat-json-jackson with camunda-spin-dataformat-all everything works fine.

I wonder if my assumption is right or if I did something wrong?


the relevant parts of my dependency delarations:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.spring.platform</groupId>
                <artifactId>platform-bom</artifactId>
                <version>Athens-SR1</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.camunda.bpm</groupId>
                <artifactId>camunda-bom</artifactId>
                <version>7.6.0</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.camunda.bpm.dmn</groupId>
                <artifactId>camunda-engine-dmn-bom</artifactId>
                <version>7.6.0</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Spring -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-amqp</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j2</artifactId>
        </dependency>
        <!-- Camunda -->
        <dependency>
            <groupId>org.camunda.bpm.extension</groupId>
            <artifactId>camunda-bpm-spring-boot-starter</artifactId>
            <version>1.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.camunda.bpm.extension</groupId>
            <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
            <version>1.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.camunda.bpm.dmn</groupId>
            <artifactId>camunda-engine-dmn</artifactId>
        </dependency>
        <dependency>
            <groupId>org.camunda.spin</groupId>
            <artifactId>camunda-spin-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.camunda.spin</groupId>
            <artifactId>camunda-spin-dataformat-json-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>org.camunda.bpm</groupId>
            <artifactId>camunda-engine-plugin-spin</artifactId>
        </dependency>
        <!-- other -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>
        <!-- testing -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.restdocs</groupId>
            <artifactId>spring-restdocs-mockmvc</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <!-- <scope>test</scope> -->
        </dependency>
        <dependency>
            <groupId>jdepend</groupId>
            <artifactId>jdepend</artifactId>
            <version>2.9.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

Hi @FrVaBe,

have you configured the Sping Process Engine Plugin?

Best,
Johannes

If you mean this

    /**
     * Bean creation method for the Camunda SpinProcessEnginePlugin.
     * 
     * @return the SpinProcessEnginePlugin bean
     * @see <a href=
     *      "https://docs.camunda.org/manual/latest/user-guide/data-formats/configuring-spin-integration/#configuring-the-spin-process-engine-plugin">Configuring
     *      the Spin Process Engine Plugin</a>
     */
    @Bean
    SpinProcessEnginePlugin spinProcessEnginePlugin() {
        return new SpinProcessEnginePlugin();
    }

yes. It all works well just by replacing camunda-spin-dataformat-json-jackson with camunda-spin-dataformat-all.

Can you please post the output of mvn dependency:tree?

Cheers,
Thorben

$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ...
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli)
[INFO] +- org.springframework.boot:spring-boot-starter:jar:1.4.2.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot:jar:1.4.2.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-context:jar:4.3.4.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.2.RELEASE:compile
[INFO] |  +- org.springframework:spring-core:jar:4.3.4.RELEASE:compile
[INFO] |  \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.4.2.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.4.2.RELEASE:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.6:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.6:compile
[INFO] |  +- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile
[INFO] |  |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
[INFO] |  |  \- com.fasterxml:classmate:jar:1.3.3:compile
[INFO] |  +- org.springframework:spring-web:jar:4.3.4.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-aop:jar:4.3.4.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-beans:jar:4.3.4.RELEASE:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:4.3.4.RELEASE:compile
[INFO] |     \- org.springframework:spring-expression:jar:4.3.4.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-amqp:jar:1.4.2.RELEASE:compile
[INFO] |  +- org.springframework:spring-messaging:jar:4.3.4.RELEASE:compile
[INFO] |  \- org.springframework.amqp:spring-rabbit:jar:1.6.5.RELEASE:compile
[INFO] |     +- org.springframework.amqp:spring-amqp:jar:1.6.5.RELEASE:compile
[INFO] |     +- org.springframework.retry:spring-retry:jar:1.1.4.RELEASE:compile
[INFO] |     +- org.springframework:spring-tx:jar:4.3.4.RELEASE:compile
[INFO] |     +- com.rabbitmq:http-client:jar:1.0.0.RELEASE:compile
[INFO] |     |  \- org.apache.httpcomponents:httpclient:jar:4.5.2:compile
[INFO] |     |     +- org.apache.httpcomponents:httpcore:jar:4.4.5:compile
[INFO] |     |     \- commons-codec:commons-codec:jar:1.10:compile
[INFO] |     \- com.rabbitmq:amqp-client:jar:3.6.5:compile
[INFO] +- org.springframework.boot:spring-boot-starter-validation:jar:1.4.2.RELEASE:compile
[INFO] |  \- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.6:compile
[INFO] +- org.springframework.boot:spring-boot-starter-log4j2:jar:1.4.2.RELEASE:compile
[INFO] |  +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.6.2:compile
[INFO] |  |  \- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] |  +- org.apache.logging.log4j:log4j-api:jar:2.6.2:compile
[INFO] |  +- org.apache.logging.log4j:log4j-core:jar:2.6.2:compile
[INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
[INFO] |  \- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
[INFO] +- org.camunda.bpm.extension:camunda-bpm-spring-boot-starter:jar:1.3.0:compile
[INFO] |  \- org.camunda.bpm:camunda-engine-spring:jar:7.6.0:compile
[INFO] |     +- org.camunda.bpm:camunda-engine:jar:7.6.0:compile
[INFO] |     |  +- org.camunda.bpm.model:camunda-bpmn-model:jar:7.6.0:compile
[INFO] |     |  +- org.camunda.bpm.model:camunda-cmmn-model:jar:7.6.0:compile
[INFO] |     |  +- org.apache.commons:commons-email:jar:1.2:compile
[INFO] |     |  |  +- javax.mail:mail:jar:1.4.1:compile
[INFO] |     |  |  \- javax.activation:activation:jar:1.1.1:compile
[INFO] |     |  +- org.mybatis:mybatis:jar:3.2.8:compile
[INFO] |     |  \- joda-time:joda-time:jar:2.9.5:compile
[INFO] |     +- org.springframework:spring-jdbc:jar:4.3.4.RELEASE:compile
[INFO] |     +- commons-lang:commons-lang:jar:2.6:compile
[INFO] |     +- org.springframework:spring-orm:jar:4.3.4.RELEASE:compile
[INFO] |     \- commons-dbcp:commons-dbcp:jar:1.4:compile
[INFO] |        \- commons-pool:commons-pool:jar:1.6:compile
[INFO] +- org.camunda.bpm.extension:camunda-bpm-spring-boot-starter-webapp:jar:1.3.0:compile
[INFO] |  +- org.camunda.bpm.webapp:camunda-webapp-webjar:jar:7.5.0:compile
[INFO] |  +- org.camunda.bpm.webapp:camunda-webapp:jar:classes:7.5.0:compile
[INFO] |  |  \- org.camunda.bpm:camunda-engine-rest-core:jar:7.5.0:compile
[INFO] |  |     +- commons-fileupload:commons-fileupload:jar:1.3.2:compile
[INFO] |  |     |  \- commons-io:commons-io:jar:2.5:compile
[INFO] |  |     \- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.8.4:compile
[INFO] |  |        \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.8.4:compile
[INFO] |  \- org.springframework.boot:spring-boot-starter-jersey:jar:1.4.2.RELEASE:compile
[INFO] |     +- org.glassfish.jersey.core:jersey-server:jar:2.23.2:compile
[INFO] |     |  +- org.glassfish.jersey.core:jersey-common:jar:2.23.2:compile
[INFO] |     |  |  +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.23.2:compile
[INFO] |     |  |  \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
[INFO] |     |  +- org.glassfish.jersey.core:jersey-client:jar:2.23.2:compile
[INFO] |     |  +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
[INFO] |     |  +- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.23.2:compile
[INFO] |     |  +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] |     |  +- org.glassfish.hk2:hk2-api:jar:2.5.0-b05:compile
[INFO] |     |  |  +- org.glassfish.hk2:hk2-utils:jar:2.5.0-b05:compile
[INFO] |     |  |  \- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.5.0-b05:compile
[INFO] |     |  +- org.glassfish.hk2.external:javax.inject:jar:2.5.0-b05:compile
[INFO] |     |  \- org.glassfish.hk2:hk2-locator:jar:2.5.0-b05:compile
[INFO] |     |     \- org.javassist:javassist:jar:3.20.0-GA:compile
[INFO] |     +- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.23.2:compile
[INFO] |     +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.23.2:compile
[INFO] |     +- org.glassfish.jersey.ext:jersey-bean-validation:jar:2.23.2:compile
[INFO] |     +- org.glassfish.jersey.ext:jersey-spring3:jar:2.23.2:compile
[INFO] |     |  +- org.glassfish.hk2:hk2:jar:2.5.0-b05:compile
[INFO] |     |  |  +- org.glassfish.hk2:config-types:jar:2.5.0-b05:compile
[INFO] |     |  |  +- org.glassfish.hk2:hk2-core:jar:2.5.0-b05:compile
[INFO] |     |  |  +- org.glassfish.hk2:hk2-config:jar:2.5.0-b05:compile
[INFO] |     |  |  +- org.glassfish.hk2:hk2-runlevel:jar:2.5.0-b05:compile
[INFO] |     |  |  \- org.glassfish.hk2:class-model:jar:2.5.0-b05:compile
[INFO] |     |  |     \- org.glassfish.hk2.external:asm-all-repackaged:jar:2.5.0-b05:compile
[INFO] |     |  \- org.glassfish.hk2:spring-bridge:jar:2.5.0-b05:compile
[INFO] |     \- org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.23.2:compile
[INFO] |        +- org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.23.2:compile
[INFO] |        \- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.8.4:compile
[INFO] +- org.camunda.bpm.dmn:camunda-engine-dmn:jar:7.6.0:compile
[INFO] |  +- org.camunda.commons:camunda-commons-utils:jar:1.4.0:compile
[INFO] |  +- org.camunda.commons:camunda-commons-typed-values:jar:1.4.0:compile
[INFO] |  +- org.camunda.bpm.model:camunda-dmn-model:jar:7.6.0:compile
[INFO] |  |  \- org.camunda.bpm.model:camunda-xml-model:jar:7.6.0:compile
[INFO] |  +- org.camunda.bpm.dmn:camunda-engine-feel-api:jar:7.6.0:compile
[INFO] |  +- org.camunda.bpm.dmn:camunda-engine-feel-juel:jar:7.6.0:compile
[INFO] |  +- de.odysseus.juel:juel-api:jar:2.2.7:compile
[INFO] |  +- de.odysseus.juel:juel-spi:jar:2.2.7:compile
[INFO] |  \- de.odysseus.juel:juel-impl:jar:2.2.7:compile
[INFO] +- org.camunda.spin:camunda-spin-core:jar:1.3.0:compile
[INFO] |  \- org.camunda.commons:camunda-commons-logging:jar:1.4.0:compile
[INFO] +- org.camunda.spin:camunda-spin-dataformat-json-jackson:jar:1.3.0:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-core:jar:2.8.4:compile
[INFO] |  \- com.jayway.jsonpath:json-path:jar:2.2.0:compile
[INFO] +- org.camunda.bpm:camunda-engine-plugin-spin:jar:7.6.0:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.4:compile
[INFO] |  \- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.4:compile
[INFO] +- org.postgresql:postgresql:jar:9.4.1212.jre7:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.4.2.RELEASE:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:1.4.2.RELEASE:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.4.2.RELEASE:test
[INFO] |  +- junit:junit:jar:4.12:test
[INFO] |  +- org.assertj:assertj-core:jar:2.5.0:test
[INFO] |  +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] |  |  \- org.objenesis:objenesis:jar:2.4:test
[INFO] |  +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] |  +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.3.0:test
[INFO] |  |  \- org.json:json:jar:20140107:test
[INFO] |  \- org.springframework:spring-test:jar:4.3.4.RELEASE:test
[INFO] +- org.springframework.restdocs:spring-restdocs-mockmvc:jar:1.1.2.RELEASE:test
[INFO] |  \- org.springframework.restdocs:spring-restdocs-core:jar:1.1.2.RELEASE:test
[INFO] |     \- javax.servlet:javax.servlet-api:jar:3.1.0:test
[INFO] +- com.h2database:h2:jar:1.4.193:compile
[INFO] \- jdepend:jdepend:jar:2.9.1:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.279 s
[INFO] Finished at: 2016-12-09T14:08:57+01:00
[INFO] Final Memory: 18M/495M
[INFO] ------------------------------------------------------------------------

I removed (only few) custom artifacts.

For some reason, you have json-path 2.2.0 on the classpath instead of 0.9.1 which is the version used in Spin 1.3.0 (see https://github.com/camunda/camunda-spin/blob/1.3.0/dataformat-json-jackson/pom.xml#L39-L49). From the log above alone I can’t tell you why that is the case, but you could investigate in that direction.

2 Likes

Thanks. Will have a look and will post the cause if found.

Found the cause. The 2.2.0 version ist declared by the Spring IO platform BOM that I also use in my pom to get a reliable set of spring module versions and artifacts.

I will go with the camunda-engine-dataformat-all artifact now because of the included and relocated version of json-path.

Thanks for your support.

1 Like

Okay, thanks for sharing the solution :slight_smile: