diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/CBApplication.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/CBApplication.java index 7c394e34c4..0b1653bf36 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/CBApplication.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/CBApplication.java @@ -48,6 +48,7 @@ import org.jkiss.dbeaver.model.app.DBPPlatform; import org.jkiss.dbeaver.model.auth.AuthInfo; import org.jkiss.dbeaver.model.auth.SMCredentialsProvider; +import org.jkiss.dbeaver.model.connection.DBPDriver; import org.jkiss.dbeaver.model.data.json.JSONUtils; import org.jkiss.dbeaver.model.navigator.DBNBrowseSettings; import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor; @@ -260,6 +261,7 @@ protected void startServer() { log.error(e); return; } + refreshDisabledDriversConfig(); configurationMode = CommonUtils.isEmpty(serverName); @@ -541,7 +543,6 @@ protected Path loadServerConfiguration() throws DBException { log.debug("Runtime configuration [" + runtimeConfigFile.getAbsolutePath() + "]"); parseConfiguration(runtimeConfigFile); } - return path; } @@ -1338,4 +1339,16 @@ protected void sendConfigChangedEvent(SMCredentialsProvider credentialsProvider) } eventController.addEvent(new WSServerConfigurationChangedEvent(sessionId, null)); } + + private void refreshDisabledDriversConfig() { + CBAppConfig config = getAppConfiguration(); + Set disabledDrivers = new LinkedHashSet<>(Arrays.asList(config.getDisabledDrivers())); + for (DBPDriver driver : CBPlatform.getInstance().getApplicableDrivers()) { + if (!driver.isEmbedded() || config.isDriverForceEnabled(driver.getFullId())) { + continue; + } + disabledDrivers.add(driver.getFullId()); + } + config.setDisabledDrivers(disabledDrivers.toArray(new String[0])); + } } diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/CBPlatform.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/CBPlatform.java index b01af47eb2..d281748bac 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/CBPlatform.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/CBPlatform.java @@ -119,8 +119,6 @@ protected synchronized void initialize() { refreshApplicableDrivers(); - refreshDisabledDriversConfig(); - new WebSessionMonitorJob(this) .scheduleMonitor(); @@ -293,18 +291,6 @@ public void refreshApplicableDrivers() { log.info("Available drivers: " + applicableDrivers.stream().map(DBPDriver::getFullName).collect(Collectors.joining(","))); } - private void refreshDisabledDriversConfig() { - CBAppConfig config = application.getAppConfiguration(); - Set disabledDrivers = new LinkedHashSet<>(Arrays.asList(config.getDisabledDrivers())); - for (DBPDriver driver : applicableDrivers) { - if (!driver.isEmbedded() || config.isDriverForceEnabled(driver.getFullId())) { - continue; - } - disabledDrivers.add(driver.getFullId()); - } - config.setDisabledDrivers(disabledDrivers.toArray(new String[0])); - } - @NotNull @Override public DBFileController createFileController() {