spring-core 5.0.0 fails at application-context load with Spring Boot 4.1.0 (Spring AMQP 4.1.0). Boot 4.0.6 (Spring AMQP 4.0.3) works.
Error
BeanCreationException: bean "rabbitListenerContainerFactory" in ee/bitweb/core/amqp/AmqpAutoConfiguration.class
→ factory method "jsaFactory" threw:
NoClassDefFoundError: org/springframework/amqp/rabbit/listener/ConditionalRejectingErrorHandler$DefaultExceptionStrategy
Root cause
In Spring AMQP 4.1, org.springframework.amqp.rabbit.listener.ConditionalRejectingErrorHandler was deprecated (@Deprecated(forRemoval = true, since = "4.1")) and relocated to org.springframework.amqp.listener. The nested DefaultExceptionStrategy no longer exists at the old coordinates, so this throws at runtime:
src/main/java/ee/bitweb/core/amqp/CoreExceptionStrategy.java:9
public class CoreExceptionStrategy extends ConditionalRejectingErrorHandler.DefaultExceptionStrategy {
Fix
The class moved to org.springframework.amqp.listener.ConditionalRejectingErrorHandler.DefaultExceptionStrategy (still public static class ... implements FatalExceptionStrategy). Update the import/extends in CoreExceptionStrategy and the ConditionalRejectingErrorHandler references in AmqpAutoConfiguration to the new package. The new package is absent in Spring AMQP 4.0.x, so this likely needs a Spring Boot 4.1 baseline.
Environment
ee.bitweb:spring-core:5.0.0
- Boot 4.1.0 / Spring AMQP 4.1.0 (fails); Boot 4.0.6 / Spring AMQP 4.0.3 (works)
- Found via a downstream Spring Boot 4.0.6 → 4.1.0 bump.
spring-core 5.0.0 fails at application-context load with Spring Boot 4.1.0 (Spring AMQP 4.1.0). Boot 4.0.6 (Spring AMQP 4.0.3) works.
Error
Root cause
In Spring AMQP 4.1,
org.springframework.amqp.rabbit.listener.ConditionalRejectingErrorHandlerwas deprecated (@Deprecated(forRemoval = true, since = "4.1")) and relocated toorg.springframework.amqp.listener. The nestedDefaultExceptionStrategyno longer exists at the old coordinates, so this throws at runtime:src/main/java/ee/bitweb/core/amqp/CoreExceptionStrategy.java:9Fix
The class moved to
org.springframework.amqp.listener.ConditionalRejectingErrorHandler.DefaultExceptionStrategy(stillpublic static class ... implements FatalExceptionStrategy). Update the import/extends inCoreExceptionStrategyand theConditionalRejectingErrorHandlerreferences inAmqpAutoConfigurationto the new package. The new package is absent in Spring AMQP 4.0.x, so this likely needs a Spring Boot 4.1 baseline.Environment
ee.bitweb:spring-core:5.0.0