From dc83dd3a3b99d79fa2df6f6f018891348b67c3ff Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 17 Sep 2018 14:46:48 +1200 Subject: Upgrade to Java 8 --- pom.xml | 48 ++++++++++++++++++++++---------------- src/org/traccar/web/WebServer.java | 19 +++++++-------- 2 files changed, 36 insertions(+), 31 deletions(-) diff --git a/pom.xml b/pom.xml index 3d66383af..cf811e817 100644 --- a/pom.xml +++ b/pom.xml @@ -11,8 +11,9 @@ UTF-8 - 9.2.24.v20180105 - 2.25.1 + 9.4.12.v20180830 + 2.26 + 2.8.4 @@ -40,17 +41,17 @@ mysql mysql-connector-java - 5.1.46 + 8.0.12 org.postgresql postgresql - 42.2.4.jre7 + 42.2.5 com.microsoft.sqlserver mssql-jdbc - 6.4.0.jre7 + 7.0.0.jre8 com.microsoft.azure @@ -60,13 +61,13 @@ com.zaxxer - HikariCP-java7 - 2.4.13 + HikariCP + 3.2.0 io.netty netty-all - 4.1.28.Final + 4.1.29.Final org.slf4j @@ -76,7 +77,7 @@ org.glassfish javax.json - 1.0.4 + 1.1.2 org.eclipse.jetty @@ -118,10 +119,20 @@ jersey-media-json-jackson ${jersey.version} + + org.glassfish.jersey.inject + jersey-hk2 + ${jersey.version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson.version} + com.fasterxml.jackson.datatype jackson-datatype-jsr353 - 2.8.4 + ${jackson.version} org.liquibase @@ -136,8 +147,8 @@ javax.mail - mail - 1.4.7 + javax.mail-api + 1.6.2 org.jxls @@ -161,13 +172,13 @@ org.apache.commons - commons-collections4 + commons-collections4 4.2 org.mnode.ical4j ical4j - 2.0.5 + 2.0.5 com.fizzed @@ -272,8 +283,8 @@ maven-compiler-plugin 3.7.0 - 1.7 - 1.7 + 1.8 + 1.8 -Xlint:unchecked @@ -289,10 +300,7 @@ - 1.7 - - *JDBC42* - + 1.8 true diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java index 8887b6af3..4bb88578f 100644 --- a/src/org/traccar/web/WebServer.java +++ b/src/org/traccar/web/WebServer.java @@ -20,11 +20,9 @@ import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.proxy.AsyncProxyServlet; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.SessionManager; import org.eclipse.jetty.server.handler.ErrorHandler; import org.eclipse.jetty.server.handler.HandlerList; import org.eclipse.jetty.server.handler.ResourceHandler; -import org.eclipse.jetty.server.session.HashSessionManager; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; @@ -63,7 +61,7 @@ public class WebServer { private final Config config; private final DataSource dataSource; private final HandlerList handlers = new HandlerList(); - private final SessionManager sessionManager; + private int sessionTimeout; private void initServer() { @@ -79,12 +77,7 @@ public class WebServer { public WebServer(Config config, DataSource dataSource) { this.config = config; this.dataSource = dataSource; - - sessionManager = new HashSessionManager(); - int sessionTimeout = config.getInteger("web.sessionTimeout"); - if (sessionTimeout != 0) { - sessionManager.setMaxInactiveInterval(sessionTimeout); - } + sessionTimeout = config.getInteger("web.sessionTimeout"); initServer(); initApi(); @@ -158,7 +151,9 @@ public class WebServer { WebAppContext app = new WebAppContext(); app.setContextPath("/"); - app.getSessionHandler().setSessionManager(sessionManager); + if (sessionTimeout > 0) { + app.getSessionHandler().setMaxInactiveInterval(sessionTimeout); + } app.setWar(config.getString("web.application")); handlers.addHandler(app); } @@ -166,7 +161,9 @@ public class WebServer { private void initApi() { ServletContextHandler servletHandler = new ServletContextHandler(ServletContextHandler.SESSIONS); servletHandler.setContextPath("/api"); - servletHandler.getSessionHandler().setSessionManager(sessionManager); + if (sessionTimeout > 0) { + servletHandler.getSessionHandler().setMaxInactiveInterval(sessionTimeout); + } servletHandler.addServlet(new ServletHolder(new AsyncSocketServlet()), "/socket"); -- cgit v1.2.3