Defensive error reporting when ConfigurationClassParser introspects declared methods via StandardAnnotationMetadata [SPR-13791] #18364
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
type: enhancement
A general enhancement
Milestone
Dave Syer opened SPR-13791 and commented
When there is a class missing from the classpath that is needed by some annotation metadata, the app blows up deep in the java.lang.Class. The exception is hard to interpret for Spring users because there is no indication what it was trying to do when it failed. Example:
where it is clear that the classpath is missing something, but not why, because Spring never tells us what it was doing, so we never find out what class it was trying to introspect (probably some autconfig from Spring Boot in this case, but it's hard to say). Maybe ConfigurationClassParser or StandardAnnotationMetadata could catch the exception and rethrow with a message that indicates what they were doing at the time?
Affects: 4.1.8, 4.2.3
Issue Links:
Referenced from: commits a36c0a5, bc492b9
Backported to: 4.1.9
The text was updated successfully, but these errors were encountered: