Error creating bean with name ‘reactiveElasticsearchClient

程序报错:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'reactiveElasticsearchClient' defined in class path resource [org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfiguration.class]: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.springframework.data.elasticsearch.client.reactive.DefaultReactiveElasticsearchClient] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7]

问题解析:

SpringBoot在启动过程中会通过启动类注解@SpringBootApplication中的自动配置注解@SpringBootConfiguration为第三方配置类创建bean对象。

这段错误表明 Spring Boot 在启动过程中,尝试创建 reactiveElasticsearchClient Bean 时出现了问题,最终导致应用启动失败。

解决方法:

由于我的程序没有用到reactiveElasticsearchClient,因此直接在启动类注解上加上如下代码,避免创建 reactiveElasticsearchClient Bean 即可解决程序报错。

java 复制代码
@SpringBootApplication(exclude = ReactiveElasticsearchRestClientAutoConfiguration.class)
相关推荐
OtIo TALL18 小时前
redis7 for windows的安装教程
java
uNke DEPH18 小时前
Spring Boot的项目结构
java·spring boot·后端
xixingzhe219 小时前
idea启动vue项目
java·vue.js·intellij-idea
wzl2026121319 小时前
企业微信定时群发技术实现与实操指南(原生接口+工具落地)
java·运维·前端·企业微信
凌波粒19 小时前
Java 8 “新”特性详解:Lambda、函数式接口、Stream、Optional 与方法引用
java·开发语言·idea
曹牧19 小时前
Eclipse:悬停提示(Hover)
java·ide·eclipse
oyzz12019 小时前
Spring EL 表达式的简单介绍和使用
java·后端·spring
iNgs IMAC20 小时前
Redis之Redis事务
java·数据库·redis
程序员小假20 小时前
向量检索的流程是怎样的?Embedding 和 Rerank 各自的作用?
java·后端
yaaakaaang20 小时前
二十二、模板方法模式
java·模板方法模式