1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
|
From: Markus Koschany <apo@debian.org>
Date: Wed, 7 May 2025 15:29:44 +0200
Subject: jetty9
Use Debian's jetty9
Forwarded: not-needed
---
main/webapp/WEB-INF/jetty-web.xml | 29 ----------------------
main/webapp/WEB-INF/web.xml | 21 ++++++++++++----
pom.xml | 2 +-
server/src/com/google/refine/Refine.java | 5 ++--
.../util/threads/ThreadPoolExecutorAdapter.java | 13 +++++-----
5 files changed, 25 insertions(+), 45 deletions(-)
delete mode 100644 main/webapp/WEB-INF/jetty-web.xml
diff --git a/main/webapp/WEB-INF/jetty-web.xml b/main/webapp/WEB-INF/jetty-web.xml
deleted file mode 100644
index 73d9140..0000000
--- a/main/webapp/WEB-INF/jetty-web.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE Configure SYSTEM "https://www.eclipse.org/jetty/configure_10_0.dtd">
-<!-- =============================================================== -->
-<!-- Mixin the GZIP Handler -->
-<!-- This applies the GZIP Handler to the entire server -->
-<!-- If a GZIP handler is required for an individual context, then -->
-<!-- use a context XML (see test.xml example in distribution) -->
-<!-- =============================================================== -->
-<Configure class="org.eclipse.jetty.webapp.WebAppContext">
- <Call name="insertHandler">
- <Arg>
- <New id="GzipHandler" class="org.eclipse.jetty.server.handler.gzip.GzipHandler">
- <Set name="minGzipSize"><Property name="jetty.gzip.minGzipSize" deprecated="gzip.minGzipSize" default="2048"/></Set>
- <Set name="inflateBufferSize"><Property name="jetty.gzip.inflateBufferSize" default="0"/></Set>
- <Set name="syncFlush"><Property name="jetty.gzip.syncFlush" default="false" /></Set>
-
- <Set name="includedMethodList"><Property name="jetty.gzip.includedMethodList" default="GET" /></Set>
- <Set name="excludedMethodList"><Property name="jetty.gzip.excludedMethodList" default="" /></Set>
-
- <Set name="dispatcherTypes" property="jetty.gzip.dispatcherTypes"/>
- <Set name="includedMimeTypesList">
- <Property name="jetty.gzip.includedMimeTypeList" default="text/html,text/plain,text/xml,application/xhtml+xml,text/css,text/javascript,application/javascript,application/json,image/svg+xml"/>
- </Set>
- <Set name="excludedMimeTypesList" property="jetty.gzip.excludedMimeTypeList"/>
- <Set name="includedPaths" property="jetty.gzip.includedPathList"/>
- <Set name="excludedPaths" property="jetty.gzip.excludedPathList"/>
- </New>
- </Arg>
- </Call>
-</Configure>
diff --git a/main/webapp/WEB-INF/web.xml b/main/webapp/WEB-INF/web.xml
index 4182ad8..11c1733 100644
--- a/main/webapp/WEB-INF/web.xml
+++ b/main/webapp/WEB-INF/web.xml
@@ -16,9 +16,23 @@
| might require different parameters.
+-->
<context-param>
- <param-name>org.eclipse.jetty.servlet.SessionPath</param-name>
+ <param-name>org.mortbay.jetty.servlet.SessionPath</param-name>
<param-value>/</param-value>
</context-param>
+
+ <filter>
+ <filter-name>GzipFilter</filter-name>
+ <filter-class>org.eclipse.jetty.servlets.GzipFilter</filter-class>
+ <init-param>
+ <param-name>mimeTypes</param-name>
+ <param-value>text/html,text/plain,text/xml,application/xhtml+xml,text/css,text/javascript,application/javascript,application/json,image/svg+xml</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>GzipFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
<servlet>
<servlet-name>refine</servlet-name>
<servlet-class>com.google.refine.RefineServlet</servlet-class>
@@ -30,10 +44,6 @@
<param-name>refine.revision</param-name>
<param-value>$REVISION</param-value>
</init-param>
- <init-param>
- <param-name>gzip</param-name>
- <param-value>true</param-value>
- </init-param>
<!-- added by Wikier, unused by us
<init-param>
<param-name>refine.data</param-name>
@@ -46,5 +56,6 @@
<servlet-name>refine</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
+
</web-app>
diff --git a/pom.xml b/pom.xml
index 483aa40..018761b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -82,7 +82,7 @@
<butterfly.version>1.2.6</butterfly.version>
<slf4j.version>2.0.16</slf4j.version>
<log4j.version>2.24.3</log4j.version>
- <jetty.version>10.0.16</jetty.version>
+ <jetty.version>9.4.52.v20230823</jetty.version>
<okhttp.version>4.12.0</okhttp.version>
<jena.version>4.10.0</jena.version>
<poi.version>5.4.0</poi.version>
diff --git a/server/src/com/google/refine/Refine.java b/server/src/com/google/refine/Refine.java
index 410b140..243043a 100644
--- a/server/src/com/google/refine/Refine.java
+++ b/server/src/com/google/refine/Refine.java
@@ -44,7 +44,6 @@ import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import java.util.Set;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@@ -225,7 +224,7 @@ class RefineServer extends Server {
this.addBean(handler);
// Tell the server we want to try and shutdown gracefully
// this means that the server will stop accepting new connections
- // right away, but it will continue to process the ones that
+ // right away but it will continue to process the ones that
// are in execution for the given timeout before attempting to stop
// NOTE: this is *not* a blocking method, it just sets a parameter
// that _server.stop() will rely on
@@ -291,7 +290,7 @@ class RefineServer extends Server {
scanner.addListener(new Scanner.BulkListener() {
@Override
- public void filesChanged(Set<String> set) {
+ public void filesChanged(@SuppressWarnings("rawtypes") List changedFiles) {
try {
logger.info("Stopping context: " + contextRoot.getAbsolutePath());
context.stop();
diff --git a/server/src/com/google/util/threads/ThreadPoolExecutorAdapter.java b/server/src/com/google/util/threads/ThreadPoolExecutorAdapter.java
index 1211cc9..561bc72 100644
--- a/server/src/com/google/util/threads/ThreadPoolExecutorAdapter.java
+++ b/server/src/com/google/util/threads/ThreadPoolExecutorAdapter.java
@@ -15,14 +15,13 @@
package com.google.util.threads;
-import java.util.EventListener;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import org.eclipse.jetty.util.component.LifeCycle;
+import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.thread.ThreadPool;
-import org.slf4j.LoggerFactory;
/**
* Jetty {@link ThreadPool} that bridges requests to a {@link ThreadPoolExecutor}.
@@ -40,7 +39,7 @@ public class ThreadPoolExecutorAdapter implements ThreadPool, LifeCycle {
try {
executor.execute(job);
} catch (RejectedExecutionException e) {
- LoggerFactory.getLogger(this.toString()).warn("Execute failed", e);
+ Log.getLog().warn(e);
}
}
@@ -111,12 +110,12 @@ public class ThreadPoolExecutorAdapter implements ThreadPool, LifeCycle {
}
@Override
- public boolean addEventListener(EventListener eventListener) {
- return false;
+ public void addLifeCycleListener(Listener listener) {
+ System.err.println("we should implement this!");
}
@Override
- public boolean removeEventListener(EventListener eventListener) {
- return false;
+ public void removeLifeCycleListener(Listener listener) {
+ System.err.println("we should implement this!");
}
}
|