Elasticsearch 5.2.2 X-Pack: Failed to load plugin class [org.elasticsearch.xpack.XPackPlugin]

Hi,

I have installed X-Pack 5.2.2 on Elasticsearch 5.2.2. I connect from java code to Elastic Search cluster, with none SSL connection. JDK is 1.8.102, I have all X-Pack jars at client classpath.
I have used following java client code:

https://www.elastic.co/guide/en/x-pack/current/java-clients.html

I am getting following when I try to establish Transport connection:

Failed to load plugin class [org.elasticsearch.xpack.XPackPlugin]
ElasticsearchException[Failed to load plugin class [org.elasticsearch.xpack.XPackPlugin]]; nested: InvocationTargetException; nested: ElasticsearchException[failed to initialize a TrustManagerFactory]; nested: NoSuchFileException[NOT_SET];
at org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:384)
at org.elasticsearch.plugins.PluginsService.(PluginsService.java:104)
at org.elasticsearch.client.transport.TransportClient.newPluginService(TransportClient.java:99)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:124)
at org.elasticsearch.client.transport.TransportClient.(TransportClient.java:258)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:125)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:55)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:50)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:46)

Any Input will be helpful.

Thanks,
Amit

It looks like you have an incomplete configuration of some X-Pack settings.

Can you provide:

  • The settings that you are passing to the PreBuiltXPackTransportClient constructor
  • The full stack trace of the exception, including the trace of the cause exceptions.

Thanks.

Thanks, Following are my settings:

Builder builder = Settings.builder();
builder.put("cluster.name","V2Dev2").put("client.transport.ping_timeout",60s);
builder.put("xpack.security.user", "abc:Pswd1234");
Settings settings = builder.build();
tclient = new PreBuiltXPackTransportClient(settings);


Do I need to Load XPackPlugin from Java code

Thanks,
Amit

Complete Log:

2017-08-07 16:16:32,759 ERROR com.searchservice.domain.factory.BoxTransportClientFactory [http-nio-7065-exec-17] PreBuiltTransportClient :Failed to load plugin class [org.elasticsearch.xpack.XPackPlugin]
ElasticsearchException[Failed to load plugin class [org.elasticsearch.xpack.XPackPlugin]]; nested: InvocationTargetException; nested: ElasticsearchException[failed to initialize a TrustManagerFactory]; nested: NoSuchFileException[NOT_SET];
at org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:384)
at org.elasticsearch.plugins.PluginsService.(PluginsService.java:104)
at org.elasticsearch.client.transport.TransportClient.newPluginService(TransportClient.java:99)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:124)
at org.elasticsearch.client.transport.TransportClient.(TransportClient.java:258)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:125)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:55)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:50)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:46)
at com.boeing.searchservice.domain.factory.BoxTransportClientFactory.getTransportClient(BoxTransportClientFactory.java:162)
at com.boeing.searchservice.domain.factory.BoxTransportClientFactory.getClient(BoxTransportClientFactory.java:119)
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.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:69)
at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:110)
at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:57)
at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93)
at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:88)
at org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:138)
at org.springframework.beans.factory.support.AbstractBeanFactory.evaluateBeanDefinitionString(AbstractBeanFactory.java:1287)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.evaluate(BeanDefinitionValueResolver.java:210)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:182)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean.....

Caused by: ElasticsearchException[failed to initialize a TrustManagerFactory]; nested: NoSuchFileException[NOT_SET];
at org.elasticsearch.xpack.ssl.StoreTrustConfig.createTrustManager(StoreTrustConfig.java:57)
at org.elasticsearch.xpack.ssl.SSLService.createSslContext(SSLService.java:378)
at org.elasticsearch.xpack.ssl.SSLService.loadSSLConfigurations(SSLService.java:401)
at org.elasticsearch.xpack.ssl.SSLService.(SSLService.java:79)
at org.elasticsearch.xpack.XPackPlugin.(XPackPlugin.java:194)
... 113 more

I got the solution it seems X-Pack CertUtils.java
was trying to load, javax.net.ssl.keyStore=NOT_SET , so If I set this it worked!

Thank You!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.