You've run into a difficult set of issues, and I'm sorry that you had to experience this pain. There are two problems. The first problem is that your node client can't deserialize the cluster state. The reason for this is because the license plugin that you installed on your master node causes some metadata to be stored in the cluster state; if the node client isn't configured to also load the license plugin then it won't know how to deserialize the cluster state. Unfortunately, this failure is silent and that's bad. See #13445 and the fix is in #15401 but that's not in a released version of Elasticsearch yet.
Okay, so now you're thinking all that you have to do is load the license plugin. Alas, that would have worked with the node builder in the 2.0.x line of Elasticsearch. However, in the 2.1.x line of Elasticsearch, this ability has been removed (see #13055). See #15927 and the links therein for a better understanding of this issue, and ways to work around it.
Hi Jason:
One of the workarounds was to include the license plugin maven dependency in the dependencies of the java app which uses Java Node Client. However
I am unable to satisfy this dependency. and I am unable to find the maven repo that would contains this :
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.