Search code examples
spring-bootjacksonopentok

Opentok SDK not Spring-boot compliant due new Jackson 2.9 release


My Spring-boot application started failing once Jackson 2.9 was released on 2nd of March. I am using Gradle for building and Spring boot version 1.5.2 which depends on Jackson-core 2.8.7.

In addition I need Opentok SDK which I have added as dependency:

compile group: 'com.tokbox', name: 'opentok-server-sdk', version: '2.3.2'

I suppose the reason is the Opentok SDK dependency definition which allows downloading newer JAR for Jackson which then creates a mismatch of libraries as several versions of Jackson JARs are downloaded:

https://github.com/opentok/Opentok-Java-SDK/blob/master/build.gradle

dependencies {
    ...
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '[2.3.1,2.99999)'

How to sort this out? I am not an expert of Gradle but could I somehow force Opentok to use 2.8.7 version? I cannot deliver at the moment at all so please help.


Solution

  • This is how I sorted it out

    compile ('com.tokbox:opentok-server-sdk:2.3.2')
    {
        // Jackson 2.9 is not compatible with Spring boot 1.4.4 - 1.5.2
        exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
    }