From 22ee9166d87a9b6a853c25c5f2bb3ff95aacad35 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 2 Apr 2018 16:00:44 +0300 Subject: xmpp: fix router init --- .../src/main/java/com/juick/server/xmpp/router/XMPPRouter.java | 6 +++--- juick-www/build.gradle | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/juick-server/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java b/juick-server/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java index e5900977..a262e941 100644 --- a/juick-server/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java +++ b/juick-server/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java @@ -47,12 +47,12 @@ public class XMPPRouter implements StreamHandler { @Value("${router_port:5347}") private int routerPort; + @Inject private XMPPServer xmppServer; - @Inject - public XMPPRouter(XMPPServer xmppServer) { + @PostConstruct + public void init() { logger.info("component router initialized"); - this.xmppServer = xmppServer; service.submit(() -> { try { listener = new ServerSocket(routerPort); diff --git a/juick-www/build.gradle b/juick-www/build.gradle index 5cebe3e8..5cad742f 100644 --- a/juick-www/build.gradle +++ b/juick-www/build.gradle @@ -23,6 +23,7 @@ apply plugin: 'org.springframework.boot' dependencies { compile project(':juick-server-jdbc') + providedCompile project(':juick-server') compile 'com.github.ben-manes.caffeine:caffeine:2.6.2' compile("org.springframework.boot:spring-boot-starter-cache") compile ('org.springframework.boot:spring-boot-starter-security') @@ -38,7 +39,7 @@ dependencies { testCompile("org.springframework.boot:spring-boot-starter-test") testCompile ('net.sourceforge.htmlunit:htmlunit:2.29') - testCompile project(':juick-server') + } compileFrontend.dependsOn 'yarn' -- cgit v1.2.3