withSerializationInclusion function is not available in latest Jackson-databind-2.9.8

599 Views Asked by At

I was trying to create CouchDBConnector object in spring boot project to get connetion to CouchDB. So this problem occured while creating connector object.

There was not much of documentation on Ektorp Github project to try.

@Bean
public CouchDbConnector firstCouchDbConnector() throws MalformedURLException {
    HttpClient httpClient = new StdHttpClient.Builder()
            .url("http://localhost:5984")
            .username("admin")
            .password("admin")
            .build();

    CouchDbInstance couchdbInstance = new StdCouchDbInstance(httpClient);
    CouchDbConnector couchDbConnector = new StdCouchDbConnector("spring", couchdbInstance);
    return couchDbConnector;
}

I expected a CouchDBConnector object to get access to CouchDB database. But all i got is this error.

Error I got in Console is :

The following method did not exist:

com.fasterxml.jackson.databind.SerializationConfig.withSerializationInclusion(Lcom/fasterxml/jackson/annotation/JsonInclude$Include;)Lcom/fasterxml/jackson/databind/SerializationConfig;

The method's class, com.fasterxml.jackson.databind.SerializationConfig, is available from the following locations:

jar:file:/C:/Users/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.9.8/11283f21cc480aa86c4df7a0a3243ec508372ed2/jackson-databind-2.9.8.jar!/com/fasterxml/jackson/databind/SerializationConfig.class

It was loaded from the following location:

file:/C:/Users/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.9.8/11283f21cc480aa86c4df7a0a3243ec508372ed2/jackson-databind-2.9.8.jar
1

There are 1 best solutions below

2
Arun Gupta On

The method withSerializationInclusion is not present in latest fasterxml.jackson library.

The error was solved by adding the dependency to an old version that contains this method.