From ef22d6d8edcf4b3a6b82ef85f4e7f44d6b48e2a8 Mon Sep 17 00:00:00 2001 From: Andrew DeMaria Date: Sun, 6 Oct 2019 19:45:21 -0600 Subject: [PATCH] Remove optional jetty runtime - Simplifies pom making future upgrades easier - Fixes tests picking up jetty runtime Signed-off-by: Andrew DeMaria --- airsonic-main/cve-suppressed.xml | 19 ++---------- airsonic-main/pom.xml | 31 ------------------- .../java/org/airsonic/player/Application.java | 8 ----- .../player/controller/StreamController.java | 4 +-- .../spring/LoggingExceptionResolver.java | 4 +-- pom.xml | 6 ---- 6 files changed, 5 insertions(+), 67 deletions(-) diff --git a/airsonic-main/cve-suppressed.xml b/airsonic-main/cve-suppressed.xml index 466bbb11..b082b45b 100644 --- a/airsonic-main/cve-suppressed.xml +++ b/airsonic-main/cve-suppressed.xml @@ -47,13 +47,6 @@ .* - - - Jetty is currently only used for developer experimentations - ^org\.eclipse\.jetty:.*$ - cpe:/a:org.eclipse.jetty: - - @@ -111,12 +104,6 @@ CVE-2016-5425 - - - - ^org\.eclipse\.jetty\..*$ - cpe:/a:mortbay_jetty:jetty - @@ -184,17 +171,17 @@ 9.0 - False positive for tomcat vuln in eclipse jetty/jasper compat lib + False positive for tomcat vuln in eclipse jasper compat lib ^org\.mortbay\.jasper:apache-jsp:.*$ CVE-2016-5425 - False positive for tomcat vuln in eclipse jetty/jasper compat lib + False positive for tomcat vuln in eclipse jasper compat lib ^org\.mortbay\.jasper:apache-jsp:.*$ CVE-2017-6056 - False positive for tomcat vuln in eclipse jetty/jasper compat lib + False positive for tomcat vuln in eclipse jasper compat lib ^org\.mortbay\.jasper:apache-jsp:.*$ CVE-2019-10072 diff --git a/airsonic-main/pom.xml b/airsonic-main/pom.xml index f3e2ab44..36130175 100755 --- a/airsonic-main/pom.xml +++ b/airsonic-main/pom.xml @@ -512,24 +512,6 @@ tomcat-embed-jasper ${tomcat.server.scope} - - - org.springframework.boot - spring-boot-starter-jetty - provided - - - org.eclipse.jetty - apache-jsp - provided - - - - - org.eclipse.jetty - jetty-io - provided - com.fasterxml.jackson.core @@ -620,8 +602,6 @@ org.airsonic.player.Application WAR - ${boot.group.excludes} - ${boot.artifact.excludes} @@ -715,17 +695,6 @@ true - - org.eclipse.jetty,org.eclipse.jetty.websocket,org.mortbay.jasper,org.eclipse.jetty.toolchain,org.ow2.asm - spring-boot-starter-jetty - - - - jetty-embed - - org.apache.tomcat.embed - spring-boot-starter-tomcat - ide-tomcat-embed diff --git a/airsonic-main/src/main/java/org/airsonic/player/Application.java b/airsonic-main/src/main/java/org/airsonic/player/Application.java index fc9f45e2..5ffd130e 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/Application.java +++ b/airsonic-main/src/main/java/org/airsonic/player/Application.java @@ -214,14 +214,6 @@ public class Application extends SpringBootServletInitializer implements Embedde LOG.warn("An error happened while trying to optimize tomcat", e); } - try { - Class jettyESCF = Class.forName("org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory"); - if (jettyESCF.isInstance(container)) { - LOG.warn("Detected Jetty web server. Here there be dragons."); - } - } catch (NoClassDefFoundError | ClassNotFoundException e) { - LOG.debug("No jetty classes found"); - } } public static void main(String[] args) { diff --git a/airsonic-main/src/main/java/org/airsonic/player/controller/StreamController.java b/airsonic-main/src/main/java/org/airsonic/player/controller/StreamController.java index bc605a23..3207af01 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/controller/StreamController.java +++ b/airsonic-main/src/main/java/org/airsonic/player/controller/StreamController.java @@ -258,9 +258,7 @@ public class StreamController { // This happens often and outside of the control of the server, so // we catch Tomcat/Jetty "connection aborted by client" exceptions // and display a short error message. - boolean shouldCatch = false; - shouldCatch |= Util.isInstanceOfClassName(e, "org.apache.catalina.connector.ClientAbortException"); - shouldCatch |= Util.isInstanceOfClassName(e, "org.eclipse.jetty.io.EofException"); + boolean shouldCatch = Util.isInstanceOfClassName(e, "org.apache.catalina.connector.ClientAbortException"); if (shouldCatch) { LOG.info("{}: Client unexpectedly closed connection while loading {} ({})", request.getRemoteAddr(), diff --git a/airsonic-main/src/main/java/org/airsonic/player/spring/LoggingExceptionResolver.java b/airsonic-main/src/main/java/org/airsonic/player/spring/LoggingExceptionResolver.java index 454a582e..691b12ea 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/spring/LoggingExceptionResolver.java +++ b/airsonic-main/src/main/java/org/airsonic/player/spring/LoggingExceptionResolver.java @@ -21,9 +21,7 @@ public class LoggingExceptionResolver implements HandlerExceptionResolver, Order // This happens often and outside of the control of the server, so // we catch Tomcat/Jetty "connection aborted by client" exceptions // and display a short error message. - boolean shouldCatch = false; - shouldCatch |= Util.isInstanceOfClassName(e, "org.apache.catalina.connector.ClientAbortException"); - shouldCatch |= Util.isInstanceOfClassName(e, "org.eclipse.jetty.io.EofException"); + boolean shouldCatch = Util.isInstanceOfClassName(e, "org.apache.catalina.connector.ClientAbortException"); if (shouldCatch) { LOG.info("{}: Client unexpectedly closed connection while loading {} ({})", request.getRemoteAddr(), Util.getAnonymizedURLForRequest(request), e.getCause().toString()); return null; diff --git a/pom.xml b/pom.xml index 091d6b31..eb72736f 100644 --- a/pom.xml +++ b/pom.xml @@ -129,12 +129,6 @@ guava 27.1-jre - - org.eclipse.jdt - ecj - 3.14.0 - provided - org.apache.ant ant