From 3bcb8787c8a8e5296df63e7f37b413ab7aec3e01 Mon Sep 17 00:00:00 2001 From: Alexander Schwartz Date: Thu, 6 Jun 2024 16:55:10 +0200 Subject: [PATCH] Remove AUTO_SERVER H2 default JDBC property This avoids problems if the hostname can't be resolved by InetAddress.getLocalHost() Closes #26042 Signed-off-by: Alexander Schwartz --- .../src/main/java/org/keycloak/config/database/Database.java | 2 +- .../quarkus/runtime/configuration/test/ConfigurationTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/quarkus/config-api/src/main/java/org/keycloak/config/database/Database.java b/quarkus/config-api/src/main/java/org/keycloak/config/database/Database.java index 1b36319106..af28909ef1 100644 --- a/quarkus/config-api/src/main/java/org/keycloak/config/database/Database.java +++ b/quarkus/config-api/src/main/java/org/keycloak/config/database/Database.java @@ -123,7 +123,7 @@ public final class Database { if ("dev-file".equalsIgnoreCase(alias)) { return addH2NonKeywords("jdbc:h2:file:${kc.home.dir:${kc.db-url-path:" + escapeReplacements(System.getProperty("user.home")) + "}}" + escapeReplacements(File.separator) + "${kc.data.dir:data}" + escapeReplacements(File.separator) + "h2" + escapeReplacements(File.separator) - + "keycloakdb${kc.db-url-properties:;;AUTO_SERVER=TRUE}"); + + "keycloakdb${kc.db-url-properties:}"); } return addH2NonKeywords("jdbc:h2:mem:keycloakdb${kc.db-url-properties:}"); } diff --git a/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/test/ConfigurationTest.java b/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/test/ConfigurationTest.java index 9107e99b09..94df7eb84c 100644 --- a/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/test/ConfigurationTest.java +++ b/quarkus/runtime/src/test/java/org/keycloak/quarkus/runtime/configuration/test/ConfigurationTest.java @@ -292,7 +292,7 @@ public class ConfigurationTest { .toString() .replaceFirst(isWindows() ? "file:///" : "file://", ""); - assertEquals("jdbc:h2:file:" + userHomeUri + "data/h2/keycloakdb;;AUTO_SERVER=TRUE;NON_KEYWORDS=VALUE", config.getConfigValue("quarkus.datasource.jdbc.url").getValue()); + assertEquals("jdbc:h2:file:" + userHomeUri + "data/h2/keycloakdb;NON_KEYWORDS=VALUE", config.getConfigValue("quarkus.datasource.jdbc.url").getValue()); ConfigArgsConfigSource.setCliArgs("--db=dev-mem"); config = createConfig();