From 8db07f51726f638f89f8b0b01b812687834576b5 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 12 Nov 2026 13:23:57 -0600 Subject: [PATCH 1/2] MODWRKFLOW-87: Add Liquibase bean that then disabled Liquibase. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously Liquibase had been disabled due to `folio-spring-support` enabling it and mod-workflow doesn’t do anything with it. This caused lots of problems. The `folio-spring-support` at some point in time following and update started getting NPEs. This was addressed in https://folio-org.atlassian.net/browse/MODWRKFLOW-65 by removing things. Thanks to the update in `folio-spring-support`, the unused Liquibase wasn’t causing problems. A significant amount of time later, under Eureka, Liquibase suddenly started acting up again. With problems like the following: ```json errors: [ { message: 'JDBC exception executing SQL [ERROR: relation "dev1_mod_workflow.trigger" does not exist\n' + ' Position: 77] [select t1_0.id,t1_0.description,t1_0.method,t1_0.name,t1_0.pathPattern from dev1_mod_workflow.Trigger t1_0 where t1_0.id=?]', type: 'SQLGrammarException', code: '500 INTERNAL_SERVER_ERROR', parameters: [] } ] ``` The problem is not relating to the Liquibase table but somehow Liquibase caused it to not exist. Setting `SPRING_LIQUIBASE_ENABLED="false"` results in further problems because `folio-spring-support` forces the requirement, even if it should be disabled: Parameter 2 of constructor in org.folio.spring.service.TenantService required a bean of type 'org.folio.spring.liquibase.FolioSpringLiquibase' that could not be found. Action: Consider defining a bean of type 'org.folio.spring.liquibase.FolioSpringLiquibase' in your configuration. The solution appears to be to bring back the previously remove FolioSpringLiquibaseConfig class but this time call this on bean creation: ```java folioSpringLiquibase.setShouldRun(false); ``` Note that the following was attempted but did not work: ```java @SpringBootApplication( scanBasePackages = { "org.folio.rest", "org.folio.spring" }, exclude = { LiquibaseAutoConfiguration.class } ) ``` ## References - https://folio-org.atlassian.net/browse/MODWRKFLOW-65 --- .../config/FolioSpringLiquibaseConfig.java | 27 +++++++++++++++++++ .../FolioSpringLiquibaseConfigTest.java | 21 +++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 service/src/main/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfig.java create mode 100644 service/src/test/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfigTest.java diff --git a/service/src/main/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfig.java b/service/src/main/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfig.java new file mode 100644 index 00000000..b2083813 --- /dev/null +++ b/service/src/main/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfig.java @@ -0,0 +1,27 @@ +package org.folio.rest.workflow.config; + +import org.folio.spring.liquibase.FolioSpringLiquibase; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class FolioSpringLiquibaseConfig { + + /** + * Enable liquibase to work-around problems where FolioSpringLiquibase requires it but it causes problems and workflow doesn't use it. + * + * Specifically disable running using configuration. + * Cannot return NULL to designate don't use because folio-spring-support doesn't verify the beans existence. + * + * @return + */ + @Bean + FolioSpringLiquibase folioSpringLiquibase() { + final FolioSpringLiquibase folioSpringLiquibase = new FolioSpringLiquibase(); + + folioSpringLiquibase.setShouldRun(false); + + return folioSpringLiquibase; + } + +} diff --git a/service/src/test/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfigTest.java b/service/src/test/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfigTest.java new file mode 100644 index 00000000..ff00235c --- /dev/null +++ b/service/src/test/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfigTest.java @@ -0,0 +1,21 @@ +package org.folio.rest.workflow.config; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest(classes = FolioSpringLiquibaseConfig.class) +class FolioSpringLiquibaseConfigTest { + + @Autowired + private FolioSpringLiquibaseConfig folioSpringLiquibaseConfig; + + @Test + void testFolioSpringLiquibaseConfigBeanExists() { + + assertNotNull(folioSpringLiquibaseConfig); + } + +} From 4a7f022f2d769f0579d0127ec8e8104b5e251ec6 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 12 Nov 2026 13:36:54 -0600 Subject: [PATCH 2/2] MODWRKFLOW-87: Add class-level documentation comments to FolioSpringLiquibaseConfig. --- .../folio/rest/workflow/config/FolioSpringLiquibaseConfig.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service/src/main/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfig.java b/service/src/main/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfig.java index b2083813..76572a45 100644 --- a/service/src/main/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfig.java +++ b/service/src/main/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfig.java @@ -4,6 +4,9 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +/** + * Provide custom overrides to FOLIO Spring Support Liquibase related configuration. + */ @Configuration public class FolioSpringLiquibaseConfig {