PropertyBatchUpdateException
: causes of nested PropertyAccessException
s not shown in output
#34691
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
when a
PropertyBatchUpdateException
gets instantiated it does not pass thePropertyAccessException
s ascause
to itssuper
(BeansException
), instead storing it locally inpropertyAccessExceptions
:spring-framework/spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java
Lines 48 to 56 in a63c5ad
this makes sense since
propertyAccessExceptions
is a list whilecause
can only be a single exception.however, the output of this is really nondescript and does not contain the actual root cause:
as you can see it includes
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'elasticsearchOperations' threw exception
which comes from its name:spring-framework/spring-beans/src/main/java/org/springframework/beans/MethodInvocationException.java
Line 44 in a63c5ad
however it doesn't say what that exception (i.e. its
cause
) is. it has a cause set (i checked with the debugger), it's just a matter of also printing it. i presume the formatting for printing is done byPropertyBatchUpdateException#toString
:spring-framework/spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java
Lines 96 to 106 in a63c5ad
it seems that the standard
PropertyAccessException#toString
does not include thecause
, so maybe that needs to be handled byPropertyBatchUpdateException#toString
?(i didn't create a minimum repro for this as i think the affected code is quite obvious from the callstacks & source links provided)
The text was updated successfully, but these errors were encountered: