Caused by: java.lang.NoClassDefFoundError:/cluster/repositories/cleanup/CleanupRepositoryRequest

Caused by: java.lang.NoClassDefFoundError: org/elasticsearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryRequest
	at org.elasticsearch.client.RestHighLevelClient.<init>(RestHighLevelClient.java:247)
	at org.elasticsearch.client.RestHighLevelClient.<init>(RestHighLevelClient.java:275)
	at org.elasticsearch.client.RestHighLevelClient.<init>(RestHighLevelClient.java:267)
	at com.tuxc.config.ElasticsearchConfig.restHighLevelClient(ElasticsearchConfig.java:23)
	at com.tuxc.config.ElasticsearchConfig$$EnhancerBySpringCGLIB$$5dbb02fc.CGLIB$restHighLevelClient$0(<generated>)
	at com.tuxc.config.ElasticsearchConfig$$EnhancerBySpringCGLIB$$5dbb02fc$$FastClassBySpringCGLIB$$133c001f.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
	at com.tuxc.config.ElasticsearchConfig$$EnhancerBySpringCGLIB$$5dbb02fc.restHighLevelClient(<generated>)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
	... 82 more
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryRequest
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 96 more

解决:
导入完整依赖

<dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-client</artifactId>
            <version>7.6.1</version>
        </dependency>

        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>7.6.1</version>
        </dependency>

        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-high-level-client</artifactId>
            <version>7.6.1</version>
        </dependency>

猜你喜欢

转载自blog.csdn.net/weixin_46684099/article/details/118941037