I have a java client (a JavaEE app built with maven and deployed on glassfish 4) that is currently unable to load x-pack plugin. Essentially the problem is that I hit an "ElasticsearchException[Failed to load plugin class [org.elasticsearch.xpack.XPack Plugin]]" exception when I instantiate the PreBuiltXPackTransportClient. The rest of the stacktrace indicates failure to initialize TrustManagerFactory but I think this is not the actual problem. The code snippet is as below
Settings settings = Settings.builder()
.put("cluster.name", "######")
.put("xpack.security.user", "####:#####")
.build();
TransportClient client = new PreBuiltXPackTransportClient(settings) // this is where the exception occurs
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("#######"), 9300));
I added the x-pack dependency in maven with the ff:
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>x-pack-transport</artifactId>
<version>5.0.0</version>
</dependency>
as instructed on https://www.elastic.co/guide/en/x-pack/current/java-clients.html
Now I noticed that this artifactId is not available in maven central. Is this dependency still valid for java clients? If so why I am getting this exception? If not, which is the right transport client class to use for comms with secured nodes. Thanks