我正在尝试使用xpack安全性连接弹性搜索(6.5.4),但出现以下错误。
这是我的代码
Settings settings = Settings.builder()
.put("cluster.name", clusterName)
.put("xpack.security.user", username + ":" + password)
.build();
elasticSearchTransportClient = new PreBuiltXPackTransportClient(settings)
.addTransportAddresses(transportAddress);
我正在使用试用许可证。
Caused by: java.lang.NoSuchFieldError: SELF_GENERATED_LICENSE_TYPE
at org.elasticsearch.xpack.core.XPackClientPlugin.getSettings(XPackClientPlugin.java:210)
at org.elasticsearch.plugins.PluginsService.lambda$getPluginSettings$0(PluginsService.java:87)
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at org.elasticsearch.plugins.PluginsService.getPluginSettings(PluginsService.java:87)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:145)
at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:284)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:128)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:47)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:42)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:38)
at com.persistent.elasticsearch.connection.ConnectionManager.init(ConnectionManager.java:52)
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:498)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1702)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1641)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)