From 76c472973ed6b05b389202fbeb2b6997be94b476 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Sun, 23 Aug 2015 11:18:38 -0700 Subject: [PATCH] Also fix order of injection with plugins for transport client See #13061 --- .../elasticsearch/client/transport/TransportClient.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java b/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java index a395475f1ea..a8e2bf54568 100644 --- a/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java +++ b/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java @@ -133,6 +133,10 @@ public class TransportClient extends AbstractClient { try { ModulesBuilder modules = new ModulesBuilder(); modules.add(new Version.Module(version)); + // plugin modules must be added here, before others or we can get crazy injection errors... + for (Module pluginModule : pluginsService.nodeModules()) { + modules.add(pluginModule); + } modules.add(new PluginsModule(pluginsService)); modules.add(new EnvironmentModule(environment)); modules.add(new SettingsModule(this.settings)); @@ -150,9 +154,6 @@ public class TransportClient extends AbstractClient { modules.add(new ClientTransportModule()); modules.add(new CircuitBreakerModule(this.settings)); - for (Module pluginModule : pluginsService.nodeModules()) { - modules.add(pluginModule); - } pluginsService.processModules(modules); Injector injector = modules.createInjector();