meilisearch / meilisearch-java

Java client for Meilisearch

Home Page:https://meilisearch.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.meilisearch.sdk.Client]: Factory method 'client' threw exception with message: okhttp3/MediaType

xddcode opened this issue · comments

Description
Using the sdk, we keep getting errors when constructing the Client object

Expected behavior
Hope to use it normally

Current behavior
The execution keeps throwing errors

Screenshots or Logs
image

Environment (please complete the following information):

  • SpringBoot3.0.5
  • jdk17
  • meilisearch-java version: 0.11.0

I have same question, and I fixed it as follow:

        <!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <version>4.10.0</version>
        </dependency>

Hey @dh-free and @YeFei572 does this always happen, or after a particular update (java or meilisearch)?

Also, @alallema I think it is good to introduce a CI action to test this repo with newer java versions as well :)

I just learned melisearch and code a demo based on the quick start guide in the official documentation. However, I encountered the error mentioned above. The version I used is the latest one and I haven't tried other versions.

Cool, thanks for the information! I'll try to submit the new GH action just to ensure we support your Java version.