diff --git a/exist-core/pom.xml b/exist-core/pom.xml
index 94ed898b780..1d813c15dfb 100644
--- a/exist-core/pom.xml
+++ b/exist-core/pom.xml
@@ -430,37 +430,16 @@
${aspectj.version}
-
- org.eclipse.jetty
- jetty-jaas
- ${jetty.version}
- runtime
-
-
-
- org.apache.servicemix.bundles
- org.apache.servicemix.bundles.antlr
-
-
-
-
-
-
- org.apache.mina
- mina-core
- 2.2.5
-
+
org.eclipse.jettyjetty-http
- ${jetty.version}org.eclipse.jettyjetty-security
- ${jetty.version}runtime
@@ -636,16 +615,16 @@
removed. Unfortunately, at this time, it is required for
Monex's Remote Console to function.
-->
- org.eclipse.jetty
- jetty-annotations
+ org.eclipse.jetty.ee10
+ jetty-ee10-annotations
- org.eclipse.jetty
- jetty-servlet
+ org.eclipse.jetty.ee10
+ jetty-ee10-servlet
- org.eclipse.jetty
- jetty-webapp
+ org.eclipse.jetty.ee10
+ jetty-ee10-webapporg.eclipse.jetty
@@ -1036,10 +1015,10 @@ The BaseX Team. The original license statement is also included below.]]>org.xmlresolver:xmlresolver:jar:${xmlresolver.version}
org.exist-db.thirdparty.org.eclipse.wst.xml:xpath2:jar:1.2.0edu.princeton.cup:java-cup:jar:10k
- org.eclipse.jetty:jetty-jaas:jar:${jetty.version}
+
org.eclipse.jetty:jetty-deploy:jar:${jetty.version}org.eclipse.jetty:jetty-jmx:jar:${jetty.version}
- org.eclipse.jetty:jetty-annotations:jar:${jetty.version}
+ org.eclipse.jetty.ee10:jetty-ee10-annotations:jar:${jetty.version}org.eclipse.jetty:jetty-security:jar:${jetty.version}${project.groupId}:exist-jetty-config:jar:${project.version}org.apache.mina:mina-core
diff --git a/exist-core/src/main/java/org/exist/http/servlets/HttpServletRequestWrapper.java b/exist-core/src/main/java/org/exist/http/servlets/HttpServletRequestWrapper.java
index 5d3e437d4a0..3daf9d1440e 100644
--- a/exist-core/src/main/java/org/exist/http/servlets/HttpServletRequestWrapper.java
+++ b/exist-core/src/main/java/org/exist/http/servlets/HttpServletRequestWrapper.java
@@ -102,7 +102,7 @@ private void initialiseWrapper() {
parseURLParameters(this.request.getQueryString());
//If POST request, Parse out parameters from the Content Body
- if ("POST".equals(request.getMethod().toUpperCase())) {
+ if ("POST".equalsIgnoreCase(request.getMethod())) {
//If there is some Content
final int contentLength = request.getContentLength();
if (contentLength > 0 || contentLength == -1) {
@@ -281,7 +281,7 @@ public BufferedReader getReader() throws IOException {
@Override
public String toString() {
// If POST request AND there is some content AND its not a file upload
- if ("POST".equals(request.getMethod().toUpperCase())
+ if ("POST".equalsIgnoreCase(request.getMethod())
&& (request.getContentLength() > 0 || request.getContentLength() == -1)
&& !request.getContentType().toUpperCase().startsWith("MULTIPART/")) {
@@ -441,11 +441,7 @@ public boolean isRequestedSessionIdFromURL() {
return request.isRequestedSessionIdFromURL();
}
- @Override
- @Deprecated
- public boolean isRequestedSessionIdFromUrl() {
- return request.isRequestedSessionIdFromUrl();
- }
+ // isRequestedSessionIdFromUrl() removed in Servlet 6.0
@Override
public boolean authenticate(final HttpServletResponse httpServletResponse) throws IOException, ServletException {
@@ -572,11 +568,7 @@ public RequestDispatcher getRequestDispatcher(final String name) {
return request.getRequestDispatcher(name);
}
- @Override
- @Deprecated
- public String getRealPath(final String path) {
- return request.getSession().getServletContext().getRealPath(path);
- }
+ // getRealPath(String) removed in Servlet 6.0 — use ServletContext.getRealPath() instead
@Override
public int getRemotePort() {
@@ -633,6 +625,21 @@ public DispatcherType getDispatcherType() {
return request.getDispatcherType();
}
+ @Override
+ public String getRequestId() {
+ return request.getRequestId();
+ }
+
+ @Override
+ public String getProtocolRequestId() {
+ return request.getProtocolRequestId();
+ }
+
+ @Override
+ public ServletConnection getServletConnection() {
+ return request.getServletConnection();
+ }
+
@Override
public void close() throws IOException {
this.is.close();
diff --git a/exist-core/src/main/java/org/exist/http/urlrewrite/XQueryURLRewrite.java b/exist-core/src/main/java/org/exist/http/urlrewrite/XQueryURLRewrite.java
index e0cef4b13d6..25b081e7669 100644
--- a/exist-core/src/main/java/org/exist/http/urlrewrite/XQueryURLRewrite.java
+++ b/exist-core/src/main/java/org/exist/http/urlrewrite/XQueryURLRewrite.java
@@ -475,7 +475,7 @@ private ModelAndView getFromCache(final String url, final Subject user) throws E
return null;
}
- try (final DBBroker broker = pool.get(Optional.ofNullable(user))) {
+ try (@SuppressWarnings("PMD.UnusedLocalVariable") final DBBroker broker = pool.get(Optional.ofNullable(user))) {
if (model.getSourceInfo().source instanceof DBSource) {
((DBSource) model.getSourceInfo().source).validate(Permission.EXECUTE);
@@ -506,25 +506,27 @@ void clearCaches() {
* @param request the http request
* @param response the http response
*/
- private void doRewrite(URLRewrite action, RequestWrapper request, final HttpServletResponse response) throws IOException, ServletException {
- if (action.getTarget() != null && !(action instanceof Redirect)) {
- final String uri = action.resolve(request);
- final URLRewrite staticRewrite = rewriteConfig.lookup(uri, request.getServerName(), true, action);
+ private void doRewrite(final URLRewrite action, final RequestWrapper request, final HttpServletResponse response) throws IOException, ServletException {
+ URLRewrite effectiveAction = action;
+ RequestWrapper effectiveRequest = request;
+ if (effectiveAction.getTarget() != null && !(effectiveAction instanceof Redirect)) {
+ final String uri = effectiveAction.resolve(effectiveRequest);
+ final URLRewrite staticRewrite = rewriteConfig.lookup(uri, effectiveRequest.getServerName(), true, effectiveAction);
if (staticRewrite != null) {
- staticRewrite.copyFrom(action);
- action = staticRewrite;
- final RequestWrapper modifiedRequest = new RequestWrapper(request);
- modifiedRequest.setPaths(uri, action.getPrefix());
+ staticRewrite.copyFrom(effectiveAction);
+ effectiveAction = staticRewrite;
+ final RequestWrapper modifiedRequest = new RequestWrapper(effectiveRequest);
+ modifiedRequest.setPaths(uri, effectiveAction.getPrefix());
if (LOG.isTraceEnabled()) {
- LOG.trace("Forwarding to : {} url: {}", action.toString(), action.getURI());
+ LOG.trace("Forwarding to : {} url: {}", effectiveAction.toString(), effectiveAction.getURI());
}
- request = modifiedRequest;
+ effectiveRequest = modifiedRequest;
}
}
- action.prepareRequest(request);
- action.doRewrite(request, response);
+ effectiveAction.prepareRequest(effectiveRequest);
+ effectiveAction.doRewrite(effectiveRequest, response);
}
protected ServletConfig getConfig() {
@@ -543,6 +545,7 @@ private URLRewrite parseAction(final HttpServletRequest request, final Element a
return rewrite;
}
+ @SuppressWarnings("PMD.UnusedPrivateMethod") // called from switch expression in service()
private void parseViews(final HttpServletRequest request, final Element view, final ModelAndView modelView) throws ServletException {
Node node = view.getFirstChild();
while (node != null) {
@@ -557,6 +560,7 @@ private void parseViews(final HttpServletRequest request, final Element view, fi
}
}
+ @SuppressWarnings("PMD.UnusedPrivateMethod") // called from switch expression in service()
private void parseErrorHandlers(final HttpServletRequest request, final Element view, final ModelAndView modelView) throws ServletException {
Node node = view.getFirstChild();
while (node != null) {
@@ -685,28 +689,30 @@ private Sequence runQuery(final DBBroker broker, final RequestWrapper request, f
}
}
- String adjustPathForSourceLookup(final String basePath, String path) {
+ String adjustPathForSourceLookup(final String basePath, final String path) {
if (LOG.isTraceEnabled()) {
LOG.trace("request path={}", path);
}
- if (basePath.startsWith(XmldbURI.EMBEDDED_SERVER_URI_PREFIX) && path.startsWith(basePath.replace(XmldbURI.EMBEDDED_SERVER_URI_PREFIX, ""))) {
- path = path.replace(basePath.replace(XmldbURI.EMBEDDED_SERVER_URI_PREFIX, ""), "");
+ String adjustedPath = path;
+ if (basePath.startsWith(XmldbURI.EMBEDDED_SERVER_URI_PREFIX) && adjustedPath.startsWith(basePath.replace(XmldbURI.EMBEDDED_SERVER_URI_PREFIX, ""))) {
+ adjustedPath = adjustedPath.replace(basePath.replace(XmldbURI.EMBEDDED_SERVER_URI_PREFIX, ""), "");
- } else if (path.startsWith("/db/")) {
- path = path.substring(4);
+ } else if (adjustedPath.startsWith("/db/")) {
+ adjustedPath = adjustedPath.substring(4);
}
- if (path.startsWith("/")) {
- path = path.substring(1);
+ if (adjustedPath.startsWith("/")) {
+ adjustedPath = adjustedPath.substring(1);
}
if (LOG.isTraceEnabled()) {
- LOG.trace("adjusted request path={}", path);
+ LOG.trace("adjusted request path={}", adjustedPath);
}
- return path;
+ return adjustedPath;
}
+ @SuppressWarnings("PMD.UnusedPrivateMethod") // called indirectly from getSourceInfo()
private SourceInfo findSource(final HttpServletRequest request, final DBBroker broker, final String basePath) {
if (LOG.isTraceEnabled()) {
LOG.trace("basePath={}", basePath);
@@ -977,9 +983,6 @@ private static class ModelAndView {
private boolean useCache = false;
private SourceInfo sourceInfo = null;
- private ModelAndView() {
- }
-
public void setSourceInfo(final SourceInfo sourceInfo) {
this.sourceInfo = sourceInfo;
}
@@ -1179,12 +1182,10 @@ public String getPathTranslated() {
return super.getSession().getServletContext().getRealPath(pathInfo);
}
- protected void setData(@Nullable byte[] data) {
- if (data == null) {
- data = new byte[0];
- }
- contentLength = data.length;
- sis = new CachingServletInputStream(data);
+ protected void setData(@Nullable final byte[] data) {
+ final byte[] effectiveData = data == null ? new byte[0] : data;
+ contentLength = effectiveData.length;
+ sis = new CachingServletInputStream(effectiveData);
}
public void addParameter(final String name, final String value) {
@@ -1380,11 +1381,7 @@ public void setStatus(final int i) {
super.setStatus(i);
}
- @Override
- public void setStatus(final int i, final String msg) {
- this.status = i;
- super.setStatus(i, msg);
- }
+ // setStatus(int, String) removed in Servlet 6.0
@Override
public void sendError(final int i, final String msg) throws IOException {
@@ -1413,10 +1410,8 @@ public void flushBuffer() throws IOException {
}
public void flush() throws IOException {
- if (cache) {
- if (contentType != null) {
- super.setContentType(contentType);
- }
+ if (cache && contentType != null) {
+ super.setContentType(contentType);
}
if (sos != null) {
final ServletOutputStream out = super.getOutputStream();
diff --git a/exist-core/src/main/java/org/exist/jetty/JettyStart.java b/exist-core/src/main/java/org/exist/jetty/JettyStart.java
index 3225fbab227..60449e2e554 100644
--- a/exist-core/src/main/java/org/exist/jetty/JettyStart.java
+++ b/exist-core/src/main/java/org/exist/jetty/JettyStart.java
@@ -26,14 +26,12 @@
import org.apache.logging.log4j.Logger;
import org.eclipse.jetty.server.*;
import org.eclipse.jetty.server.handler.ContextHandler;
-import org.eclipse.jetty.server.handler.HandlerWrapper;
-import org.eclipse.jetty.servlet.ServletContextHandler;
-import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
+import org.eclipse.jetty.ee10.servlet.ServletHolder;
import org.eclipse.jetty.util.Jetty;
-import org.eclipse.jetty.util.MultiException;
import org.eclipse.jetty.util.component.LifeCycle;
-import org.eclipse.jetty.util.resource.PathResource;
import org.eclipse.jetty.util.resource.Resource;
+import org.eclipse.jetty.util.resource.ResourceFactory;
import org.eclipse.jetty.xml.XmlConfiguration;
import org.exist.SystemProperties;
import org.exist.http.servlets.ExistExtensionServlet;
@@ -68,7 +66,7 @@
/**
* This class provides a main method to start Jetty with eXist. It registers shutdown
* handlers to cleanly shut down the database and the webserver.
- *
+ *
* @author wolf
*/
public class JettyStart extends Observable implements LifeCycle.Listener {
@@ -149,8 +147,6 @@ public synchronized void run(final boolean standalone) {
return jettyPath;
});
- System.setProperty("org.eclipse.jetty.util.log.class", "org.eclipse.jetty.util.log.Slf4jLog");
-
final Path jettyConfig;
if (standalone) {
jettyConfig = Paths.get(jettyProperty).normalize().resolve("etc").resolve(Main.STANDALONE_ENABLED_JETTY_CONFIGS);
@@ -159,7 +155,7 @@ public synchronized void run(final boolean standalone) {
}
run(new String[] { jettyConfig.toAbsolutePath().toString() }, null);
}
-
+
public synchronized void run(final String[] args, final Observer observer) {
if (args.length == 0) {
logger.error("No configuration file specified!");
@@ -261,7 +257,7 @@ public synchronized void run(final String[] args, final Observer observer) {
XmlConfiguration last = null;
for(final Path confFile : configFiles) {
logger.info("[loading jetty configuration : {}]", confFile.toString());
- final Resource resource = new PathResource(confFile);
+ final Resource resource = ResourceFactory.root().newResource(confFile);
final XmlConfiguration configuration = new XmlConfiguration(resource);
if (last != null) {
configuration.getIdMap().putAll(last.getIdMap());
@@ -303,7 +299,7 @@ public synchronized void run(final String[] args, final Observer observer) {
allPorts.append(networkConnector.getLocalPort());
}
}
-
+
//*************************************************************
final List serverUris = getSeverURIs(server);
if(!serverUris.isEmpty()) {
@@ -317,9 +313,9 @@ public synchronized void run(final String[] args, final Observer observer) {
}
logger.info("Configured contexts:");
- final LinkedHashSet handlers = getAllHandlers(server.getHandler());
+ final List handlers = getAllHandlers(server.getHandler());
for (final Handler handler: handlers) {
-
+
if (handler instanceof ContextHandler contextHandler) {
logger.info("{} ({})", contextHandler.getContextPath(), contextHandler.getDisplayName());
}
@@ -348,29 +344,7 @@ public synchronized void run(final String[] args, final Observer observer) {
setChanged();
notifyObservers(SIGNAL_STARTED);
-
- } catch (final MultiException e) {
-
- // Mute the BindExceptions
-
- boolean hasBindException = false;
- for (final Throwable t : e.getThrowables()) {
- if (t instanceof java.net.BindException) {
- hasBindException = true;
- logger.error("----------------------------------------------------------");
- logger.error("ERROR: Could not bind to port because {}", t.getMessage());
- logger.error(t.toString());
- logger.error("----------------------------------------------------------");
- }
- }
- // If it is another error, print stacktrace
- if (!hasBindException) {
- e.printStackTrace();
- }
- setChanged();
- notifyObservers(SIGNAL_ERROR);
-
} catch (final SocketException e) {
logger.error("----------------------------------------------------------");
logger.error("ERROR: Could not bind to port because {}", e.getMessage());
@@ -378,7 +352,7 @@ public synchronized void run(final String[] args, final Observer observer) {
logger.error("----------------------------------------------------------");
setChanged();
notifyObservers(SIGNAL_ERROR);
-
+
} catch (final Exception e) {
e.printStackTrace();
setChanged();
@@ -386,36 +360,30 @@ public synchronized void run(final String[] args, final Observer observer) {
}
}
- private LinkedHashSet getAllHandlers(final Handler handler) {
- if(handler instanceof HandlerWrapper handlerWrapper) {
- final LinkedHashSet handlers = new LinkedHashSet<>();
- handlers.add(handlerWrapper);
- if(handlerWrapper.getHandler() != null) {
- handlers.addAll(getAllHandlers(handlerWrapper.getHandler()));
- }
- return handlers;
+ private List getAllHandlers(final Handler handler) {
+ final List handlers = new ArrayList<>();
+ handlers.add(handler);
- } else if(handler instanceof HandlerContainer handlerContainer) {
- final LinkedHashSet handlers = new LinkedHashSet<>();
- handlers.add(handler);
- for(final Handler childHandler : handlerContainer.getChildHandlers()) {
+ if (handler instanceof Handler.Wrapper wrapper) {
+ if (wrapper.getHandler() != null) {
+ handlers.addAll(getAllHandlers(wrapper.getHandler()));
+ }
+ } else if (handler instanceof Handler.Container container) {
+ for (final Handler childHandler : container.getHandlers()) {
handlers.addAll(getAllHandlers(childHandler));
}
- return handlers;
-
- } else {
- //assuming just Handler
- final LinkedHashSet handlers = new LinkedHashSet<>();
- handlers.add(handler);
- return handlers;
}
+
+ return handlers;
}
/**
* See {@link Server#getURI()}
*/
private List getSeverURIs(final Server server) {
- final ContextHandler context = server.getChildHandlerByClass(ContextHandler.class);
+ final ContextHandler context = server.getHandler() instanceof Handler.Container container
+ ? container.getDescendant(ContextHandler.class)
+ : null;
return Arrays.stream(server.getConnectors())
.filter(connector -> connector instanceof NetworkConnector)
.map(connector -> (NetworkConnector)connector)
@@ -438,9 +406,13 @@ private URI getURI(final NetworkConnector networkConnector, final ContextHandler
}
String host = null;
- if (context != null && context.getVirtualHosts() != null && context.getVirtualHosts().length > 0) {
- host = context.getVirtualHosts()[0];
- } else {
+ if (context != null) {
+ final List virtualHosts = context.getVirtualHosts();
+ if (virtualHosts != null && !virtualHosts.isEmpty()) {
+ host = virtualHosts.getFirst();
+ }
+ }
+ if (host == null) {
host = networkConnector.getHost();
}
@@ -492,11 +464,9 @@ private Optional startJetty(final List
- org.eclipse.jetty.websocket
- websocket-jetty-server
+ org.eclipse.jetty.ee10.websocket
+ jetty-ee10-websocket-jetty-serverruntime
- org.eclipse.jetty.websocket
- websocket-jakarta-server
+ org.eclipse.jetty.ee10.websocket
+ jetty-ee10-websocket-jakarta-serverruntime
@@ -339,12 +339,12 @@
src/main/config/**src/main/scripts/codesign-jansi-mac.shsrc/main/xslt/configure_10_0.dtd
- src/main/xslt/web-app_5_0.xsd
+ src/main/xslt/web-app_6_0.xsdsrc/main/xslt/jakartaee_web_services_client_2_0.xsd
- src/main/xslt/jsp_3_0.xsd
+ src/main/xslt/jsp_3_1.xsdsrc/main/xslt/xml.xsd
- src/main/xslt/web-common_5_0.xsd
- src/main/xslt/jakartaee_9.xsd
+ src/main/xslt/web-common_6_0.xsd
+ src/main/xslt/jakartaee_10.xsd
diff --git a/exist-distribution/src/main/xslt/catalog.xml b/exist-distribution/src/main/xslt/catalog.xml
index e61c7b15f71..fe614df02e1 100644
--- a/exist-distribution/src/main/xslt/catalog.xml
+++ b/exist-distribution/src/main/xslt/catalog.xml
@@ -24,6 +24,6 @@
-
+
diff --git a/exist-distribution/src/main/xslt/jakartaee_9.xsd b/exist-distribution/src/main/xslt/jakartaee_10.xsd
similarity index 86%
rename from exist-distribution/src/main/xslt/jakartaee_9.xsd
rename to exist-distribution/src/main/xslt/jakartaee_10.xsd
index 16136f9ff39..ca995082568 100644
--- a/exist-distribution/src/main/xslt/jakartaee_9.xsd
+++ b/exist-distribution/src/main/xslt/jakartaee_10.xsd
@@ -4,11 +4,11 @@
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
- version="8">
+ version="10">
- Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
@@ -49,7 +49,7 @@
+ schemaLocation="https://www.w3.org/2001/xml.xsd"/>
@@ -156,6 +156,22 @@
type="jakartaee:administered-objectType"
minOccurs="0"
maxOccurs="unbounded"/>
+
+
+
+
@@ -420,6 +436,129 @@
+
+
+
+
+
+
+ Configuration of a ContextService.
+
+
+
+
+
+
+
+
+ Description of this ContextService.
+
+
+
+
+
+
+
+
+ JNDI name of the ContextService instance being defined.
+ The JNDI name must be in a valid Jakarta EE namespace,
+ such as java:comp, java:module, java:app, or java:global.
+
+
+
+
+
+
+
+
+ Types of context to clear whenever a thread runs a
+ contextual task or action. The thread's previous context
+ is restored afterward. Context types that are defined by
+ the Jakarta EE Concurrency specification include:
+ Application, Security, Transaction,
+ and Remaining, which means all available thread context
+ types that are not specified elsewhere. You can also specify
+ vendor-specific context types. Absent other configuration,
+ cleared context defaults to Transaction. You can specify
+ a single cleared element with no value to indicate an
+ empty list of context types to clear. If neither
+ propagated nor unchanged specify (or default to) Remaining,
+ then Remaining is automatically appended to the list of
+ cleared context types.
+
+
+
+
+
+
+
+
+ Types of context to capture from the requesting thread
+ and propagate to a thread that runs a contextual task
+ or action. The captured context is re-established
+ when threads run the contextual task or action,
+ with the respective thread's previous context being
+ restored afterward. Context types that are defined by
+ the Jakarta EE Concurrency specification include:
+ Application, Security,
+ and Remaining, which means all available thread context
+ types that are not specified elsewhere. You can also specify
+ vendor-specific context types. Absent other configuration,
+ propagated context defaults to Remaining. You can specify
+ a single propagated element with no value to indicate that
+ no context types should be propagated.
+
+
+
+
+
+
+
+
+ Types of context that are left alone when a thread runs a
+ contextual task or action. Context types that are defined
+ by the Jakarta EE Concurrency specification include:
+ Application, Security, Transaction,
+ and Remaining, which means all available thread context
+ types that are not specified elsewhere. You can also specify
+ vendor-specific context types. Absent other configuration,
+ unchanged context defaults to empty. You can specify
+ a single unchanged element with no value to indicate that
+ no context types should be left unchanged.
+
+
+
+
+
+
+
+
+ Vendor-specific property.
+
+
+
+
+
+
+
+
+
@@ -1857,6 +1996,296 @@
+
+
+
+
+
+
+ Configuration of a ManagedExecutorService.
+
+
+
+
+
+
+
+
+ Description of this ManagedExecutorService.
+
+
+
+
+
+
+
+
+ JNDI name of the ManagedExecutorService instance being defined.
+ The JNDI name must be in a valid Jakarta EE namespace,
+ such as java:comp, java:module, java:app, or java:global.
+
+
+
+
+
+
+
+
+ Refers to the name of a ContextServiceDefinition or
+ context-service deployment descriptor element,
+ which determines how context is applied to tasks and actions
+ that run on this executor.
+ The name must be in a valid Jakarta EE namespace,
+ such as java:comp, java:module, java:app, or java:global.
+ In the absence of a configured value,
+ java:comp/DefaultContextService is used.
+
+
+
+
+
+
+
+
+ Upper bound on contextual tasks and actions that this executor
+ will simultaneously execute asynchronously. This constraint does
+ not apply to tasks and actions that the executor runs inline,
+ such as when a thread requests CompletableFuture.join and the
+ action runs inline if it has not yet started.
+ The default is unbounded, although still subject to
+ resource constraints of the system.
+
+
+
+
+
+
+
+
+ The amount of time in milliseconds that a task or action
+ can execute before it is considered hung.
+
+
+
+
+
+
+
+
+ Vendor-specific property.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Configuration of a ManagedScheduledExecutorService.
+
+
+
+
+
+
+
+
+ Description of this ManagedScheduledExecutorService.
+
+
+
+
+
+
+
+
+ JNDI name of the ManagedScheduledExecutorService instance
+ being defined.
+ The JNDI name must be in a valid Jakarta EE namespace,
+ such as java:comp, java:module, java:app, or java:global.
+
+
+
+
+
+
+
+
+ Refers to the name of a ContextServiceDefinition or
+ context-service deployment descriptor element,
+ which determines how context is applied to tasks and actions
+ that run on this executor.
+ The name must be in a valid Jakarta EE namespace,
+ such as java:comp, java:module, java:app, or java:global.
+ In the absence of a configured value,
+ java:comp/DefaultContextService is used.
+
+
+
+
+
+
+
+
+ Upper bound on contextual tasks and actions that this executor
+ will simultaneously execute asynchronously. This constraint does
+ not apply to tasks and actions that the executor runs inline,
+ such as when a thread requests CompletableFuture.join and the
+ action runs inline if it has not yet started. This constraint also
+ does not apply to tasks that are scheduled via the schedule methods.
+ The default is unbounded, although still subject to
+ resource constraints of the system.
+
+
+
+
+
+
+
+
+ The amount of time in milliseconds that a task or action
+ can execute before it is considered hung.
+
+
+
+
+
+
+
+
+ Vendor-specific property.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Configuration of a ManagedThreadFactory.
+
+
+
+
+
+
+
+
+ Description of this ManagedThreadFactory.
+
+
+
+
+
+
+
+
+ JNDI name of the ManagedThreadFactory instance being defined.
+ The JNDI name must be in a valid Jakarta EE namespace,
+ such as java:comp, java:module, java:app, or java:global.
+
+
+
+
+
+
+
+
+ Refers to the name of a ContextServiceDefinition or
+ context-service deployment descriptor element,
+ which determines how context is applied to threads
+ from this thread factory.
+ The name must be in a valid Jakarta EE namespace,
+ such as java:comp, java:module, java:app, or java:global.
+ In the absence of a configured value,
+ java:comp/DefaultContextService is used.
+
+
+
+
+
+
+
+
+ Priority for threads created by this thread factory.
+ The default is 5 (java.lang.Thread.NORM_PRIORITY).
+
+
+
+
+
+
+
+
+ Vendor-specific property.
+
+
+
+
+
+
+
+
+
@@ -2093,6 +2522,25 @@
+
+
+
+
+
+
+ Specifies a thread priority value in the range of
+ 1 (java.lang.Thread.MIN_PRIORITY) to 10 (java.lang.Thread.MAX_PRIORITY).
+
+
+
+
+
+
+
+
+
+
+
diff --git a/exist-distribution/src/main/xslt/jsp_3_0.xsd b/exist-distribution/src/main/xslt/jsp_3_1.xsd
similarity index 94%
rename from exist-distribution/src/main/xslt/jsp_3_0.xsd
rename to exist-distribution/src/main/xslt/jsp_3_1.xsd
index bb059b06616..e3c2e461c1c 100644
--- a/exist-distribution/src/main/xslt/jsp_3_0.xsd
+++ b/exist-distribution/src/main/xslt/jsp_3_1.xsd
@@ -5,11 +5,11 @@
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
- version="3.0">
+ version="3.1">
- Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
@@ -29,12 +29,12 @@
- This is the XML Schema for the JSP 3.0 deployment descriptor
- types. The JSP 3.0 schema contains all the special
+ This is the XML Schema for the JSP 3.1 deployment descriptor
+ types. The JSP 3.1 schema contains all the special
structures and datatypes that are necessary to use JSP files
from a web application.
- The contents of this schema is used by the web-common_5_0.xsd
+ The contents of this schema is used by the web-common_6_0.xsd
file to define JSP specific content.
@@ -58,7 +58,7 @@
-
+
@@ -152,6 +152,19 @@
+
+
+
+
+ Can be used to easily set the errorOnELNotFound
+ property of a group of JSP pages. By default, this
+ property is false.
+
+
+
+
diff --git a/exist-distribution/src/main/xslt/web-app_5_0.xsd b/exist-distribution/src/main/xslt/web-app_6_0.xsd
similarity index 97%
rename from exist-distribution/src/main/xslt/web-app_5_0.xsd
rename to exist-distribution/src/main/xslt/web-app_6_0.xsd
index 55d11dbdc4a..a2683739084 100644
--- a/exist-distribution/src/main/xslt/web-app_5_0.xsd
+++ b/exist-distribution/src/main/xslt/web-app_6_0.xsd
@@ -5,11 +5,11 @@
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
- version="5.0">
+ version="6.0">
- Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
@@ -29,7 +29,7 @@
+ version="6.0">
...
@@ -51,7 +51,7 @@
the schema using the xsi:schemaLocation attribute for Jakarta EE
namespace with the following location:
- https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd
+ https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd
]]>
@@ -75,7 +75,7 @@
-
+
diff --git a/exist-distribution/src/main/xslt/web-common_5_0.xsd b/exist-distribution/src/main/xslt/web-common_6_0.xsd
similarity index 95%
rename from exist-distribution/src/main/xslt/web-common_5_0.xsd
rename to exist-distribution/src/main/xslt/web-common_6_0.xsd
index ee12bea82e7..20b3132cff5 100644
--- a/exist-distribution/src/main/xslt/web-common_5_0.xsd
+++ b/exist-distribution/src/main/xslt/web-common_6_0.xsd
@@ -5,11 +5,11 @@
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
- version="5.0">
+ version="6.0">
- Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
@@ -29,7 +29,7 @@
+ version="6.0">
...
@@ -51,7 +51,7 @@
the schema using the xsi:schemaLocation attribute for Jakarta EE
namespace with the following location:
- https://jakarta.ee/xml/ns/jakartaee/web-common_5_0.xsd
+ https://jakarta.ee/xml/ns/jakartaee/web-common_6_0.xsd
]]>
@@ -75,9 +75,9 @@
-
+
-
+
@@ -165,6 +165,50 @@
+
+
+
+
+
+
+ This type is a general type that can be used to declare
+ attribute/value lists.
+
+
+
+
+
+
+
+
+
+ The attribute-name element contains the name of an
+ attribute.
+
+
+
+
+
+
+
+
+ The attribute-value element contains the value of a
+ attribute.
+
+
+
+
+
+
+
+
+
@@ -985,6 +1029,19 @@
+
+
+
+
+ The attribute-param element contains a name/value pair to
+ be added as an attribute to every session cookie.
+
+
+
+
@@ -1181,7 +1238,7 @@
-
+
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-annotations.xml b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-annotations.xml
index 94c9786921e..c2d64377967 100644
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-annotations.xml
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-annotations.xml
@@ -5,16 +5,8 @@
-
+
-
-
+
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-deploy.xml b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-deploy.xml
index 9897e17b70e..a4f912d7dc0 100644
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-deploy.xml
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-deploy.xml
@@ -2,61 +2,35 @@
-
-
-
-
-
+
+
-
-
-
-
-
-
-
- org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern
- .*/[^/]*servlet-api-[^/]*\.jar$|.*/jakarta.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$
-
-
-
-
-
-
-
-
- /etc/
- /etc/webdefault.xml
-
-
-
-
-
-
+
+
+
+
+ /exist
+ /../../../webapp/
+ /etc/webdefault.xml
+
+
+
+
+ Test JAAS Realm
+ JAASLoginService
-
-
-
-
-
+
+
+ org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern
+ .*/[^/]*servlet-api-[^/]*\.jar$|.*/jakarta.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$|.*/content/.*\.jar$
+
+
+
+
+
+
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-gzip.xml b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-gzip.xml
index 9a0632df3d7..f95e3dfb3c9 100644
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-gzip.xml
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-gzip.xml
@@ -14,46 +14,11 @@
-
-
-
-
-
-
-
-
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-jmx.xml b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-jmx.xml
index 24c0e2031d4..d37744ee954 100644
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-jmx.xml
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-jmx.xml
@@ -22,11 +22,4 @@
-
-
-
-
-
-
-
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-logging.xml b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-logging.xml
index 620f17ea09c..254c99d086b 100644
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-logging.xml
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-logging.xml
@@ -7,7 +7,7 @@
-
+
@@ -27,13 +27,7 @@
-
- Redirecting stderr/stdout to
-
-
-
-
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-ssl.xml b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-ssl.xml
index 447a15a21b6..bfc2dd1cf4f 100644
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-ssl.xml
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty-ssl.xml
@@ -49,10 +49,10 @@
-
-
-
-
+
+
+
+
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty.xml b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty.xml
index 6c67a0a9882..b4518e3d416 100644
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty.xml
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/jetty.xml
@@ -24,7 +24,7 @@
-
+
@@ -73,9 +73,9 @@
-
+
-
+
@@ -90,8 +90,8 @@
-
-
+
+
@@ -100,7 +100,7 @@
-
+
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-jetty-deploy.xml b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-jetty-deploy.xml
index 05432c62cfc..5c6439e3b2d 100644
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-jetty-deploy.xml
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-jetty-deploy.xml
@@ -2,61 +2,35 @@
-
-
-
-
-
+
+
-
-
-
-
-
-
-
- org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern
- .*/[^/]*servlet-api-[^/]*\.jar$|.*/jakarta.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$
-
-
-
-
-
-
-
-
- /etc/
- /etc/webdefault.xml
-
-
-
-
-
-
+
+
+
+
+ /
+ /../../../standalone-webapp/
+ /etc/webdefault.xml
+
+
+
+
+ Test JAAS Realm
+ JAASLoginService
-
-
-
-
-
+
+
+ org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern
+ .*/[^/]*servlet-api-[^/]*\.jar$|.*/jakarta.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$
+
+
+
+
+
+
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-jetty-ssl.xml b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-jetty-ssl.xml
index bcb1448f465..b04b50206ce 100644
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-jetty-ssl.xml
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-jetty-ssl.xml
@@ -49,10 +49,10 @@
-
-
-
-
+
+
+
+
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-jetty.xml b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-jetty.xml
index ce3b380b7e7..40a8c4454dd 100644
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-jetty.xml
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-jetty.xml
@@ -24,7 +24,7 @@
-
+
@@ -73,9 +73,9 @@
-
+
-
+
@@ -90,8 +90,8 @@
-
-
+
+
@@ -100,7 +100,7 @@
-
+
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-webapps/exist-webapp-context.xml b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-webapps/exist-webapp-context.xml
index 05ef5bcda5c..ed0aaa0bde1 100644
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-webapps/exist-webapp-context.xml
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone-webapps/exist-webapp-context.xml
@@ -7,9 +7,9 @@
/../../../standalone-webapp//etc/webdefault.xml
-
+
-
+ Test JAAS RealmJAASLoginService
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone.enabled-jetty-configs b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone.enabled-jetty-configs
index bd2a4da7c7c..e3851b0608e 100644
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone.enabled-jetty-configs
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/standalone.enabled-jetty-configs
@@ -41,9 +41,9 @@ jetty-ssl-context.xml
jetty-https.xml
-### Webapp deployment
-standalone-jetty-deploy.xml
+### Annotation support
+jetty-annotations.xml
-### Annotation support
-jetty-annotations.xml
+### Webapp deployment
+standalone-jetty-deploy.xml
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webapps/exist-webapp-context.xml b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webapps/exist-webapp-context.xml
index 73c5b7e633a..6fc2206fb17 100644
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webapps/exist-webapp-context.xml
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webapps/exist-webapp-context.xml
@@ -7,9 +7,9 @@
/../../../webapp//etc/webdefault.xml
-
+
-
+ Test JAAS RealmJAASLoginService
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webapps/portal/WEB-INF/jetty-web.xml b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webapps/portal/WEB-INF/jetty-web.xml
index cdb3382bbba..dd4688fe4f6 100755
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webapps/portal/WEB-INF/jetty-web.xml
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webapps/portal/WEB-INF/jetty-web.xml
@@ -1,6 +1,6 @@
-
+//etc/webdefault.xml
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webapps/portal/WEB-INF/web.xml b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webapps/portal/WEB-INF/web.xml
index aee0c88368f..3ec6b4e59a7 100755
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webapps/portal/WEB-INF/web.xml
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webapps/portal/WEB-INF/web.xml
@@ -2,9 +2,9 @@
+ version="6.0">
eXist-db portalProvides an entry point for the / root context
diff --git a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webdefault.xml b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webdefault.xml
index a3653bda8f8..d01a7abf169 100644
--- a/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webdefault.xml
+++ b/exist-jetty-config/src/main/resources/org/exist/jetty/etc/webdefault.xml
@@ -2,9 +2,9 @@
+ version="6.0">
@@ -30,19 +30,14 @@
-
-
-
-
- org.eclipse.jetty.servlet.listener.ELContextCleaner
-
-
+
+
-
+
- org.eclipse.jetty.servlet.listener.IntrospectorCleaner
+ org.eclipse.jetty.ee10.servlet.listener.IntrospectorCleaner
@@ -159,7 +154,7 @@
default
- org.eclipse.jetty.servlet.DefaultServlet
+ org.eclipse.jetty.ee10.servlet.DefaultServletacceptRangestrue
diff --git a/exist-jetty-config/src/main/resources/standalone-webapp/WEB-INF/web.xml b/exist-jetty-config/src/main/resources/standalone-webapp/WEB-INF/web.xml
index 9b075a19685..dd33e81a13b 100644
--- a/exist-jetty-config/src/main/resources/standalone-webapp/WEB-INF/web.xml
+++ b/exist-jetty-config/src/main/resources/standalone-webapp/WEB-INF/web.xml
@@ -9,9 +9,9 @@
+ version="6.0">
eXist-db – Open Source Native XML DatabaseeXist-db XML Database
diff --git a/exist-jetty-config/src/main/resources/webapp/WEB-INF/web.xml b/exist-jetty-config/src/main/resources/webapp/WEB-INF/web.xml
index dc9885872ca..2d241df3cde 100644
--- a/exist-jetty-config/src/main/resources/webapp/WEB-INF/web.xml
+++ b/exist-jetty-config/src/main/resources/webapp/WEB-INF/web.xml
@@ -8,9 +8,9 @@
+ version="6.0">
eXist Open Source Native XML DatabaseeXist XML Database
diff --git a/exist-parent/pom.xml b/exist-parent/pom.xml
index 4c9650a180c..c20ab074680 100644
--- a/exist-parent/pom.xml
+++ b/exist-parent/pom.xml
@@ -115,11 +115,11 @@
4.0.54.0.22.0.3
- 11.0.25
+ 12.0.162.25.34.10.41.8.1.3
- 1.8.1.3-jakarta5
+ 1.8.1.3-jakarta-ee102.1.39.9.1-86.0.21
@@ -157,7 +157,7 @@
jakarta.servletjakarta.servlet-api
- 5.0.0
+ 6.0.0
@@ -321,83 +321,79 @@
${apache.httpcomponents.version}
+
org.eclipse.jetty
- jetty-annotations
+ jetty-server${jetty.version}
-
-
- org.eclipse.jetty.toolchain
- jetty-jakarta-servlet-api
-
- org.eclipse.jetty
- jetty-deploy
+ jetty-xml${jetty.version}org.eclipse.jetty
- jetty-jmx
+ jetty-util${jetty.version}org.eclipse.jetty
- jetty-jndi
+ jetty-jmx${jetty.version}org.eclipse.jetty
- jetty-plus
+ jetty-security${jetty.version}org.eclipse.jetty
- jetty-server
+ jetty-http${jetty.version}
-
-
- org.eclipse.jetty.toolchain
- jetty-jakarta-servlet-api
-
-
+
- org.eclipse.jetty
- jetty-servlet
+ org.eclipse.jetty.ee10
+ jetty-ee10-annotations${jetty.version}org.eclipse.jetty
- jetty-util
+ jetty-deploy${jetty.version}
- org.eclipse.jetty
- jetty-webapp
+ org.eclipse.jetty.ee10
+ jetty-ee10-jndi${jetty.version}
- org.eclipse.jetty.websocket
- websocket-jetty-server
+ org.eclipse.jetty.ee10
+ jetty-ee10-plus${jetty.version}
-
-
- org.eclipse.jetty.toolchain
- jetty-jakarta-servlet-api
-
-
-
- org.eclipse.jetty.websocket
- websocket-jakarta-server
+ org.eclipse.jetty.ee10
+ jetty-ee10-servlet${jetty.version}
- org.eclipse.jetty
- jetty-xml
+ org.eclipse.jetty.ee10
+ jetty-ee10-webapp
+ ${jetty.version}
+
+
+
+
+ org.eclipse.jetty.ee10.websocket
+ jetty-ee10-websocket-jetty-server
+ ${jetty.version}
+
+
+
+ org.eclipse.jetty.ee10.websocket
+ jetty-ee10-websocket-jakarta-server${jetty.version}
@@ -491,8 +487,9 @@
${milton.version}
+
- org.exist-db.thirdparty.com.ettrema
+ com.evolvedbinary.thirdparty.com.ettremamilton-servlet${milton.servlet.version}
diff --git a/extensions/debuggee/src/test/resources/standalone-webapp/WEB-INF/web.xml b/extensions/debuggee/src/test/resources/standalone-webapp/WEB-INF/web.xml
index 4722b24716c..6359e6f427c 100644
--- a/extensions/debuggee/src/test/resources/standalone-webapp/WEB-INF/web.xml
+++ b/extensions/debuggee/src/test/resources/standalone-webapp/WEB-INF/web.xml
@@ -25,9 +25,9 @@
+ version="6.0">
eXist-db – Open Source Native XML DatabaseeXist-db XML Database
diff --git a/extensions/exquery/restxq/src/main/java/org/exist/extensions/exquery/restxq/impl/adapters/HttpServletResponseAdapter.java b/extensions/exquery/restxq/src/main/java/org/exist/extensions/exquery/restxq/impl/adapters/HttpServletResponseAdapter.java
index 332f9666fa8..e2e99914c63 100644
--- a/extensions/exquery/restxq/src/main/java/org/exist/extensions/exquery/restxq/impl/adapters/HttpServletResponseAdapter.java
+++ b/extensions/exquery/restxq/src/main/java/org/exist/extensions/exquery/restxq/impl/adapters/HttpServletResponseAdapter.java
@@ -51,7 +51,8 @@ public void setHeader(final String name, final String value) {
@Override
public void setStatus(final HttpStatus status, final String reason) {
- response.setStatus(status.getStatus(), reason);
+ // setStatus(int, String) removed in Servlet 6.0; reason phrase ignored
+ response.setStatus(status.getStatus());
}
@Override
diff --git a/extensions/exquery/restxq/src/test/resources/standalone-webapp/WEB-INF/web.xml b/extensions/exquery/restxq/src/test/resources/standalone-webapp/WEB-INF/web.xml
index cda73403067..30904d4ba01 100644
--- a/extensions/exquery/restxq/src/test/resources/standalone-webapp/WEB-INF/web.xml
+++ b/extensions/exquery/restxq/src/test/resources/standalone-webapp/WEB-INF/web.xml
@@ -30,9 +30,9 @@
+ version="6.0">
eXist-db – Open Source Native XML DatabaseeXist-db XML Database
diff --git a/extensions/modules/file/src/test/resources/standalone-webapp/WEB-INF/web.xml b/extensions/modules/file/src/test/resources/standalone-webapp/WEB-INF/web.xml
index 4722b24716c..6359e6f427c 100644
--- a/extensions/modules/file/src/test/resources/standalone-webapp/WEB-INF/web.xml
+++ b/extensions/modules/file/src/test/resources/standalone-webapp/WEB-INF/web.xml
@@ -25,9 +25,9 @@
+ version="6.0">
eXist-db – Open Source Native XML DatabaseeXist-db XML Database
diff --git a/extensions/modules/persistentlogin/src/test/resources/standalone-webapp/WEB-INF/web.xml b/extensions/modules/persistentlogin/src/test/resources/standalone-webapp/WEB-INF/web.xml
index 4722b24716c..6359e6f427c 100644
--- a/extensions/modules/persistentlogin/src/test/resources/standalone-webapp/WEB-INF/web.xml
+++ b/extensions/modules/persistentlogin/src/test/resources/standalone-webapp/WEB-INF/web.xml
@@ -25,9 +25,9 @@
+ version="6.0">
eXist-db – Open Source Native XML DatabaseeXist-db XML Database
diff --git a/extensions/webdav/pom.xml b/extensions/webdav/pom.xml
index 9d62bedd323..2d6aecd910c 100644
--- a/extensions/webdav/pom.xml
+++ b/extensions/webdav/pom.xml
@@ -83,8 +83,9 @@
runtime
+
- org.exist-db.thirdparty.com.ettrema
+ com.evolvedbinary.thirdparty.com.ettremamilton-servlet
diff --git a/extensions/webdav/src/test/java/org/exist/webdav/LockTest.java b/extensions/webdav/src/test/java/org/exist/webdav/LockTest.java
new file mode 100644
index 00000000000..f660745ce8c
--- /dev/null
+++ b/extensions/webdav/src/test/java/org/exist/webdav/LockTest.java
@@ -0,0 +1,155 @@
+/*
+ * eXist-db Open Source Native XML Database
+ * Copyright (C) 2001 The eXist-db Authors
+ *
+ * info@exist-db.org
+ * http://www.exist-db.org
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.exist.webdav;
+
+import com.bradmcevoy.http.exceptions.BadRequestException;
+import com.bradmcevoy.http.exceptions.ConflictException;
+import com.bradmcevoy.http.exceptions.NotAuthorizedException;
+import com.bradmcevoy.http.exceptions.NotFoundException;
+import com.ettrema.httpclient.*;
+import org.apache.http.impl.client.AbstractHttpClient;
+import org.exist.TestUtils;
+import org.exist.test.ExistWebServer;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.nio.file.Files;
+
+import static org.junit.Assert.*;
+
+/**
+ * Tests for WebDAV LOCK and UNLOCK operations.
+ */
+public class LockTest {
+
+ @ClassRule
+ public static final ExistWebServer existWebServer = new ExistWebServer(true, false, true, true);
+
+ @ClassRule
+ public static final TemporaryFolder tempFolder = new TemporaryFolder();
+
+ @Test
+ public void lockAndUnlockXmlDocument() throws IOException, NotAuthorizedException, BadRequestException,
+ HttpException, ConflictException, NotFoundException, URISyntaxException {
+ final String docName = "webdav-lock-test.xml";
+ final String docContent = "lock test";
+
+ final Host host = buildHost();
+ final Folder folder = host.getFolder("/");
+ assertNotNull(folder);
+
+ // store document
+ final java.io.File tmpFile = tempFolder.newFile();
+ Files.writeString(tmpFile.toPath(), docContent);
+ assertNotNull(folder.uploadFile(docName, tmpFile, null));
+
+ // lock
+ final String docUri = docUri(docName);
+ final String lockToken = host.doLock(docUri);
+ assertNotNull("LOCK should return a lock token", lockToken);
+ assertFalse("Lock token should not be empty", lockToken.isEmpty());
+
+ // unlock
+ final int unlockStatus = host.doUnLock(docUri, lockToken);
+ assertTrue("UNLOCK should return 2xx status, got " + unlockStatus,
+ unlockStatus >= 200 && unlockStatus < 300);
+ }
+
+ @Test
+ public void lockAndUnlockBinDocument() throws IOException, NotAuthorizedException, BadRequestException,
+ HttpException, ConflictException, NotFoundException, URISyntaxException {
+ final String docName = "webdav-lock-test.bin";
+ final String docContent = "binary lock test data";
+
+ final Host host = buildHost();
+ final Folder folder = host.getFolder("/");
+ assertNotNull(folder);
+
+ // store document
+ final java.io.File tmpFile = tempFolder.newFile();
+ Files.writeString(tmpFile.toPath(), docContent);
+ assertNotNull(folder.uploadFile(docName, tmpFile, null));
+
+ // lock
+ final String docUri = docUri(docName);
+ final String lockToken = host.doLock(docUri);
+ assertNotNull("LOCK should return a lock token", lockToken);
+
+ // unlock
+ final int unlockStatus = host.doUnLock(docUri, lockToken);
+ assertTrue("UNLOCK should return 2xx status, got " + unlockStatus,
+ unlockStatus >= 200 && unlockStatus < 300);
+ }
+
+ @Test
+ public void relockReturnsFreshToken() throws IOException, NotAuthorizedException, BadRequestException,
+ HttpException, ConflictException, NotFoundException, URISyntaxException {
+ final String docName = "webdav-relock-test.xml";
+ final String docContent = "relock test";
+
+ final Host host = buildHost();
+ final Folder folder = host.getFolder("/");
+ assertNotNull(folder);
+
+ // store document
+ final java.io.File tmpFile = tempFolder.newFile();
+ Files.writeString(tmpFile.toPath(), docContent);
+ assertNotNull(folder.uploadFile(docName, tmpFile, null));
+
+ final String docUri = docUri(docName);
+
+ // first lock
+ final String lockToken1 = host.doLock(docUri);
+ assertNotNull("First LOCK should succeed", lockToken1);
+
+ // second lock by same user replaces the lock
+ final String lockToken2 = host.doLock(docUri);
+ assertNotNull("Second LOCK by same user should succeed", lockToken2);
+
+ // cleanup: unlock with latest token
+ host.doUnLock(docUri, lockToken2);
+ }
+
+ private String docUri(final String docName) {
+ return "http://localhost:" + existWebServer.getPort() + "/webdav/db/" + docName;
+ }
+
+ private Host buildHost() {
+ final HostBuilder builder = new HostBuilder();
+ builder.setServer("localhost");
+ builder.setPort(existWebServer.getPort());
+ builder.setUser(TestUtils.ADMIN_DB_USER);
+ builder.setPassword(TestUtils.ADMIN_DB_PWD);
+ builder.setRootPath("webdav/db");
+ final Host host = builder.buildHost();
+
+ // preemptive Basic auth for all requests
+ final AbstractHttpClient httpClient = (AbstractHttpClient) host.getClient();
+ httpClient.addRequestInterceptor(new AlwaysBasicPreAuth(TestUtils.ADMIN_DB_USER, TestUtils.ADMIN_DB_PWD));
+
+ return host;
+ }
+}
diff --git a/extensions/webdav/src/test/resources/standalone-webapp/WEB-INF/web.xml b/extensions/webdav/src/test/resources/standalone-webapp/WEB-INF/web.xml
index 3a4f5698102..8779b57ee79 100644
--- a/extensions/webdav/src/test/resources/standalone-webapp/WEB-INF/web.xml
+++ b/extensions/webdav/src/test/resources/standalone-webapp/WEB-INF/web.xml
@@ -25,9 +25,9 @@
+ version="6.0">
eXist-db – Open Source Native XML DatabaseeXist-db XML Database