This is an automated email from the ASF dual-hosted git repository.

jamesfredley pushed a commit to branch fix/8.0.x-merge-sb4-fallout
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit 2850d1082a66003b162d37145855e1e7242ef71f
Author: James Fredley <[email protected]>
AuthorDate: Thu May 21 19:32:32 2026 -0400

    Remove slf4j-simple from dbmigration; Logback is now the only binding
    
    The 7.2.x merge brought back testRuntimeOnly 'org.slf4j:slf4j-simple'
    in grails-data-hibernate5/dbmigration/build.gradle. On the 8.0.x stack
    spring-boot-starter-tomcat transitively pulls in
    spring-boot-starter-logging which provides logback-classic, so leaving
    slf4j-simple on the integration test classpath gives SLF4J two
    competing bindings. Spring Boot's LogbackLoggingSystem aborts context
    startup with "LoggerFactory is not a Logback LoggerContext but Logback
    is on the classpath" the moment a Grails @Integration spec tries to
    load an ApplicationContext.
    
    Locally this took down all three specs in the module:
    AutoRunWithMultipleDataSourceSpec, AutoRunWithSingleDataSourceSpec,
    and DbUpdateCommandSpec. Removing the slf4j-simple line lets the SB
    provided Logback binding take over and all three pass again.
    
    jul-to-slf4j is left in place because Liquibase still uses
    java.util.logging and we want that output bridged to SLF4J.
    
    Assisted-by: claude-code:claude-opus-4-7
---
 grails-data-hibernate5/dbmigration/build.gradle | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/grails-data-hibernate5/dbmigration/build.gradle 
b/grails-data-hibernate5/dbmigration/build.gradle
index 9d3d4a1ac8..41cac23017 100644
--- a/grails-data-hibernate5/dbmigration/build.gradle
+++ b/grails-data-hibernate5/dbmigration/build.gradle
@@ -75,9 +75,12 @@ dependencies {
     testImplementation project(':grails-testing-support-web')
     testImplementation 'com.h2database:h2'
 
-    // Liquibase uses JUL for logging -> redirect it to SLF4J to reliably 
capture its output
+    // Liquibase uses JUL for logging -> redirect it to SLF4J to reliably 
capture its output.
+    // Spring Boot's starter (transitively via spring-boot-starter-tomcat) 
already supplies
+    // Logback as the SLF4J binding; adding slf4j-simple here would cause two 
competing
+    // bindings and Spring Boot's LogbackLoggingSystem aborts context startup 
when that
+    // happens. See https://www.slf4j.org/codes.html#multiple_bindings
     testRuntimeOnly 'org.slf4j:jul-to-slf4j'
-    testRuntimeOnly 'org.slf4j:slf4j-simple'
 }
 
 tasks.named('test', Test) {

Reply via email to