Better error reporting for @Bean creating when bean instance has been replaced with an incompatible type #28897
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
This would be even tougher to spot the error if the
BeanPostProcessor
instance is from other libraries.12:43:19.439 [main] WARN
org.springframework.context.annotation.AnnotationConfigApplicationContext
- Exception encountered during context initialization - cancelling refresh attempt:org.springframework.beans.factory.BeanCreationException
: Error creating bean with name 'taskExecutor' defined incom.welcome.samples.junit.BeanPostProcessorComponentTest$CustomAsyncConfigurer
: Bean instantiation via factory method failed; nested exception isorg.springframework.beans.BeanInstantiationException
: Failed to instantiate [java.util.concurrent.Executor
]: Illegal arguments to factory method 'getAsyncExecutor'; args: ; nested exception isjava.lang.IllegalArgumentException
: object is not an instance of declaring classThe text was updated successfully, but these errors were encountered: