解决springboot整合es8.6.2抛出ClassNotFoundException: jakarta.json.spi.JsonProvider

2023-09-09 15:51:42 浏览数 (1)

解决依赖版本问题和冲突:

代码语言:javascript复制
<dependency>
    <groupId>co.elastic.clients</groupId>
    <artifactId>elasticsearch-java</artifactId>
    <version>8.6.2</version>
    <exclusions>
        <exclusion>
            <artifactId>jakarta.json-api</artifactId>
            <groupId>jakarta.json</groupId>
        </exclusion>
        <exclusion>
            <artifactId>elasticsearch-rest-client</artifactId>
            <groupId>org.elasticsearch.client</groupId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.elasticsearch.client</groupId>
    <artifactId>elasticsearch-rest-client</artifactId>
    <version>8.6.2</version>
</dependency>
<dependency>
    <groupId>jakarta.json</groupId>
    <artifactId>jakarta.json-api</artifactId>
    <version>2.1.2</version>
</dependency>
<dependency>
    <groupId>jakarta.json.bind</groupId>
    <artifactId>jakarta.json.bind-api</artifactId>
    <version>3.0.0</version>
</dependency>
<dependency>
    <groupId>org.eclipse</groupId>
    <artifactId>yasson</artifactId>
    <version>3.0.3</version>
    <exclusions>
        <exclusion>
            <artifactId>jakarta.json-api</artifactId>
            <groupId>jakarta.json</groupId>
        </exclusion>
        <exclusion>
            <artifactId>jakarta.json.bind-api</artifactId>
            <groupId>jakarta.json.bind</groupId>
        </exclusion>
        <exclusion>
            <artifactId>parsson</artifactId>
            <groupId>org.eclipse.parsson</groupId>
        </exclusion>
    </exclusions>
</dependency>

0 人点赞