From 88de45c6955a006c65af3c98f6edba0117fb91a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20L=C3=A9aut=C3=A9?= Date: Fri, 29 Aug 2014 15:13:52 -0700 Subject: [PATCH] ensure jackson injection is available on startup --- common/src/main/java/io/druid/guice/DruidSecondaryModule.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/io/druid/guice/DruidSecondaryModule.java b/common/src/main/java/io/druid/guice/DruidSecondaryModule.java index fbafb29d42b..d768a60a7c1 100644 --- a/common/src/main/java/io/druid/guice/DruidSecondaryModule.java +++ b/common/src/main/java/io/druid/guice/DruidSecondaryModule.java @@ -71,7 +71,8 @@ public class DruidSecondaryModule implements Module binder.install(new DruidGuiceExtensions()); binder.bind(Properties.class).toInstance(properties); binder.bind(ConfigurationObjectFactory.class).toInstance(factory); - binder.bind(ObjectMapper.class).to(Key.get(ObjectMapper.class, Json.class)); + // make objectMapper eager to ensure jackson gets setup with guice injection for JsonConfigurator + binder.bind(ObjectMapper.class).to(Key.get(ObjectMapper.class, Json.class)).asEagerSingleton(); binder.bind(Validator.class).toInstance(validator); binder.bind(JsonConfigurator.class).toInstance(jsonConfigurator); }