<p dir="auto">The error message caused by the query at the top does not give any sane hint as to what is actually wrong:</p>
<p dir="auto"><a href="https://gist.github.com/0dc816b64318e5898b62">https://gist.github.com/0dc816b64318e5898b62</a></p>
<p dir="auto">Error messages should be a bit more helpful and actually try to tell the user what was expected.</p>
<p dir="auto">In 2.1.1 (and, I think, all 2.X versions), there's no support for loading plugins to a client-only node.</p>
<p dir="auto">For example, there's no (obvious) way to load plugins when doing something like:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Node node = NodeBuilder.nodeBuilder()
        .clusterName(&quot;my-cluster&quot;)
        .settings(settings)
        .client(true)
        .build();"><pre class="notranslate"><span class="pl-smi">Node</span> <span class="pl-s1">node</span> = <span class="pl-smi">NodeBuilder</span>.<span class="pl-en">nodeBuilder</span>()
        .<span class="pl-en">clusterName</span>(<span class="pl-s">"my-cluster"</span>)
        .<span class="pl-en">settings</span>(<span class="pl-s1">settings</span>)
        .<span class="pl-en">client</span>(<span class="pl-c1">true</span>)
        .<span class="pl-en">build</span>();</pre></div>
<p dir="auto">An <code class="notranslate">addPlugin</code> method on NodeBuilder along the lines of <code class="notranslate">TransportClient.addPlugin</code> would be helpful.</p>
<p dir="auto">The work-around is to override Node, duplicate the environment/version constructor logic, and provide your custom list of plugins to load:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="private static class PluginEnabledNode extends Node {
    public PluginEnabledNode(Settings settings, Collection&lt;Class&lt;? extends Plugin&gt;&gt; plugins) {
        super(InternalSettingsPreparer.prepareEnvironment(settings, null),
                Version.CURRENT,
                plugins);
    }
}"><pre class="notranslate"><span class="pl-k">private</span> <span class="pl-k">static</span> <span class="pl-k">class</span> <span class="pl-smi">PluginEnabledNode</span> <span class="pl-k">extends</span> <span class="pl-smi">Node</span> {
    <span class="pl-k">public</span> <span class="pl-smi">PluginEnabledNode</span>(<span class="pl-smi">Settings</span> <span class="pl-s1">settings</span>, <span class="pl-smi">Collection</span>&lt;<span class="pl-smi">Class</span>&lt;? <span class="pl-k">extends</span> <span class="pl-smi">Plugin</span>&gt;&gt; <span class="pl-s1">plugins</span>) {
        <span class="pl-en">super</span>(<span class="pl-smi">InternalSettingsPreparer</span>.<span class="pl-en">prepareEnvironment</span>(<span class="pl-s1">settings</span>, <span class="pl-c1">null</span>),
                <span class="pl-smi">Version</span>.<span class="pl-c1">CURRENT</span>,
                <span class="pl-s1">plugins</span>);
    }
}</pre></div>
<p dir="auto">And then you can directly instantiate a <code class="notranslate">PluginEnabledNode</code> (being careful to set "node.client" and "cluster.name" in your settings)</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Node node = new PluginEnabledNode(settings, ImmutableList.&lt;Class&lt;? extends Plugin&gt;&gt;of(CloudAwsPlugin.class)).start()"><pre class="notranslate"><span class="pl-smi">Node</span> <span class="pl-s1">node</span> = <span class="pl-k">new</span> <span class="pl-smi">PluginEnabledNode</span>(<span class="pl-s1">settings</span>, <span class="pl-smi">ImmutableList</span>.&lt;<span class="pl-smi">Class</span>&lt;? <span class="pl-k">extends</span> <span class="pl-smi">Plugin</span>&gt;&gt;<span class="pl-en">of</span>(<span class="pl-smi">CloudAwsPlugin</span>.<span class="pl-k">class</span>)).<span class="pl-en">start</span>()</pre></div>
<p dir="auto">Note to anyone attempting this work-around -- my initial attempt resulted in a very large number of Guice related injection errors when the Node was initializing.  These were due to a library version conflict between what was used by my project and what was used by the plugin I was adding.  In my case, I had an older version of Jackson and the plugin was using a new version that relied on methods that didn't exist in the older version.</p>