Skip to content

Commit

Permalink
[fix] jetty configuration changes crash eXist-db
Browse files Browse the repository at this point in the history
Updated jetty-http.xml and jetty-ssl.xml were being written by the configurator with a bad DTD, which on subsequent read by the configurator caused an exception, so that the NEXT versions of jetty-http.xml and jetty-ssl.xml were made empty.

1. Fix the DTD reference.

Also, configurator was reading the wrong field(s) for the http configuration, so

2. make configurator read the correct fields for jetty http configuration, so that subsequent edits of an already re-configured jetty don’t end up re-introducing the default (8080)
  • Loading branch information
alanpaxton committed May 2, 2023
1 parent 96939cc commit eb838b6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ public ConfigurationDialog(Consumer<Boolean> callback) {
if (ports.containsKey("jetty.port")) {
httpPort.setValue(ports.get("jetty.port"));
}
if (ports.containsKey("jetty.http.port")) {
httpPort.setValue(ports.get("jetty.http.port"));
}
if (ports.containsKey("ssl.port")) {
sslPort.setValue(ports.get("ssl.port"));
}
if (ports.containsKey("jetty.ssl.port")) {
sslPort.setValue(ports.get("jetty.ssl.port"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private static void getJettyPorts(Map<String, Integer> ports, Path jettyConfig)
final int status = reader.next();
if (status == XMLStreamReader.START_ELEMENT && "SystemProperty".equals(reader.getLocalName())) {
final String name = reader.getAttributeValue(null, "name");
if (name != null && (name.equals("jetty.port") || name.equals("jetty.ssl.port"))) {
if (name != null && (name.equals("jetty.http.port") || name.equals("jetty.ssl.port"))) {
final String defaultValue = reader.getAttributeValue(null, "default");
if (defaultValue != null) {
try {
Expand Down
4 changes: 2 additions & 2 deletions exist-core/src/main/resources/org/exist/launcher/jetty.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure.dtd"/>
<xsl:output indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_10_0.dtd"/>

<xsl:preserve-space elements="*"/>
<xsl:strip-space elements="Set"/>

<xsl:param name="port">8080</xsl:param>
<xsl:param name="port.ssl">8443</xsl:param>

<xsl:template match="SystemProperty[@name='jetty.port']"><SystemProperty name="jetty.port" default="{$port}"/></xsl:template>
<xsl:template match="SystemProperty[@name='jetty.http.port']"><SystemProperty name="jetty.http.port" default="{$port}"/></xsl:template>

<xsl:template match="SystemProperty[@name='jetty.ssl.port']"><SystemProperty name="jetty.ssl.port" default="{$port.ssl}"/></xsl:template>

Expand Down

0 comments on commit eb838b6

Please sign in to comment.