1

I recently updated my jackson-databind module from 2.11.1 to 2.12.1 and in the documentation i found that it is recommended to use blackbird module instead of afterburner. But after upgaridng i am getting this error

com.fasterxml.jackson.module.blackbird.BlackbirdModule Unable to find Java 9+ MethodHandles.privateLookupIn.  Blackbird is not performing optimally! - @ ->  
java.lang.NoSuchMethodException: no such method: java.lang.invoke.MethodHandles.privateLookupIn(Class,Lookup)Lookup/invokeStatic

So i wanted to know is there a way to use blackbird with java8.

My pom.xml entries for jackson dependencies looks like below

    <jackson.version>2.12.1</jackson.version> <!-- https://github.com/FasterXML/jackson-core/blob/master/release-notes/VERSION-2.x -->
        <jackson-databind.version>2.12.1</jackson-databind.version>    
<dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson-databind.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.jaxrs</groupId>
                <artifactId>jackson-jaxrs-json-provider</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jsr310</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jdk8</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.module</groupId>
                <artifactId>jackson-module-blackbird</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-xml</artifactId>
                <version>${jackson.version}</version>
            </dependency>

2 Answers2

3

First of all this is a warning message. Not an error and the functionality will not break. It is recommended to have java 9+ for Blackbird module because Blackbird module uses privateLookupIn method introduced in Java 9.

Even though it is compatible with Java 8, you can not get the best performance and you will get this warning message if you run in Java 8 environment.

If you want to get rid of this warning message, you need to remove Blackbird module and use the Afterburner.

JDeVas
  • 63
  • 1
  • 6
-1

I found out if you put the afterburner jar in the classpath the warning will go away.

Yunnosch
  • 26,130
  • 9
  • 42
  • 54