Error TrustManagerFactory - Failed to load plugin class [org.elasticsearch.xpack.XPackPlugin]

Hello,

I created cloud cluster and run class TransportClient, but when mounting the TransportClient object, the following error occurs:

Exception in thread "main" ElasticsearchException[Failed to load plugin class [org.elasticsearch.xpack.XPackPlugin]]; nested: InvocationTargetException; nested: ElasticsearchException[failed to initialize a TrustManagerFactory]; nested: SecurityException[class "org.bouncycastle.asn1.x509.Extensions"'s signer information does not match signer information of other classes in the same package];
at org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:462)
at org.elasticsearch.plugins.PluginsService.(PluginsService.java:116)
at org.elasticsearch.client.transport.TransportClient.newPluginService(TransportClient.java:81)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:106)
at org.elasticsearch.client.transport.TransportClient.(TransportClient.java:228)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:69)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:50)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:46)
at org.elasticsearch.cloud.transport.example.TransportExample.run(TransportExample.java:90)
at org.elasticsearch.cloud.transport.example.TransportExample.main(TransportExample.java:53)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:451)
... 9 more
Caused by: ElasticsearchException[failed to initialize a TrustManagerFactory]; nested: SecurityException[class "org.bouncycastle.asn1.x509.Extensions"'s signer information does not match signer information of other classes in the same package];
at org.elasticsearch.xpack.ssl.StoreTrustConfig.createTrustManager(StoreTrustConfig.java:57)
at org.elasticsearch.xpack.ssl.SSLService.createSslContext(SSLService.java:387)
at org.elasticsearch.xpack.ssl.SSLService.loadSSLConfigurations(SSLService.java:410)
at org.elasticsearch.xpack.ssl.SSLService.(SSLService.java:78)
at org.elasticsearch.xpack.XPackPlugin.(XPackPlugin.java:181)
... 14 more
Caused by: java.lang.SecurityException: class "org.bouncycastle.asn1.x509.Extensions"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(ClassLoader.java:898)
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:668)
at java.lang.ClassLoader.defineClass(ClassLoader.java:761)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
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)
at org.elasticsearch.xpack.ssl.StoreTrustConfig.createTrustManager(StoreTrustConfig.java:55)
... 18 more

Please, can you help me?

At a guess, I would say that you have incompatible, or multiples versions of bouncy castle libraries on your classpath.
The X-Pack client plugin uses 2 bouncycastle libraries:

  • bcpkix-jdk15on-1.55.jar
  • bcprov-jdk15on-1.55.jar

Check your classpath for other libraries that are named "bc*" or are in the maven group org.bouncycastle.

Thank You, problem resolved!

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