From 10e624937adaf2dc6cdfad9f214552e6a2fcd9eb Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 11 Apr 2018 11:20:19 +0300 Subject: server: twitter4j initialization fix --- juick-server/src/main/java/com/juick/server/TwitterManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/juick-server/src/main/java/com/juick/server/TwitterManager.java b/juick-server/src/main/java/com/juick/server/TwitterManager.java index 8e000b07..d386423b 100644 --- a/juick-server/src/main/java/com/juick/server/TwitterManager.java +++ b/juick-server/src/main/java/com/juick/server/TwitterManager.java @@ -31,6 +31,7 @@ import twitter4j.TwitterFactory; import twitter4j.conf.ConfigurationBuilder; import javax.annotation.Nonnull; +import javax.annotation.PostConstruct; import javax.inject.Inject; /** @@ -49,9 +50,10 @@ public class TwitterManager { @Value("${twitter_consumer_secret:secret}") private String twitter_consumer_secret; - private final ConfigurationBuilder configurationBuilder; + private ConfigurationBuilder configurationBuilder; - public TwitterManager() { + @PostConstruct + public void init() { configurationBuilder = new ConfigurationBuilder() .setDebugEnabled(true) .setOAuthConsumerKey(twitter_consumer_key) -- cgit v1.2.3