Bug Report
Affected version: Seata 2.5.0, 2.x branch
Severity: High — Saga auto-configuration is completely skipped on Spring Boot 4.x
Root Cause
SeataSagaAutoConfiguration uses a hardcoded class reference in @AutoConfigureAfter:
@AutoConfigureAfter({DataSourceAutoConfiguration.class, SeataAutoConfiguration.class})
where DataSourceAutoConfiguration.class resolves to org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration at compile time.
In Spring Boot 4.x, this class has been moved to org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration. The old class no longer exists, causing JVM to throw TypeNotPresentException when introspecting the meta-annotation, which silently skips the entire auto-configuration.
Symptom
Failed to introspect meta-annotation @AutoConfigureAfter on
SeataSagaAutoConfiguration: java.lang.TypeNotPresentException:
Type org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration not present
Fix Pattern (already used by SeataDataSourceAutoConfiguration)
SeataDataSourceAutoConfiguration already uses string-based names to avoid this:
@AutoConfigureAfter(
value = {SeataCoreAutoConfiguration.class},
name = "org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration")
The same approach should be applied to SeataSagaAutoConfiguration.
Expected Fix
@AutoConfigureAfter(value = {SeataAutoConfiguration.class},
name = {"org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration",
"org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration"})
Remove the import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; line.
This fix is consistent with:
Bug Report
Affected version: Seata 2.5.0, 2.x branch
Severity: High — Saga auto-configuration is completely skipped on Spring Boot 4.x
Root Cause
SeataSagaAutoConfigurationuses a hardcoded class reference in@AutoConfigureAfter:where
DataSourceAutoConfiguration.classresolves toorg.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfigurationat compile time.In Spring Boot 4.x, this class has been moved to
org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration. The old class no longer exists, causing JVM to throwTypeNotPresentExceptionwhen introspecting the meta-annotation, which silently skips the entire auto-configuration.Symptom
Fix Pattern (already used by SeataDataSourceAutoConfiguration)
SeataDataSourceAutoConfigurationalready uses string-based names to avoid this:The same approach should be applied to
SeataSagaAutoConfiguration.Expected Fix
Remove the
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;line.This fix is consistent with:
SeataDataSourceAutoConfiguration(already uses string name)TransactionAutoConfigurationinSeataSpringFenceAutoConfiguration)