Skip to content

Improve exception handling in PropertyPlaceholderConfigurer [SPR-7510] #12167

@spring-projects-issues

Description

@spring-projects-issues

Kenny MacLeod opened SPR-7510 and commented

The processProperties() method of PropertyPlaceholderConfigurer has a catch-all for any Exception thrown by the visitor. The exception's message is extracted and passed to a re-thrown BeanStoreDefinitionException. However, the remainder of the original exception (including any stack trace) is lost.

This is a problem for unhelpful exceptions like NullPointerException where the exception message is useless.

Can the original exception be preserved, either by passing it as the root cause of the BeanStoreDefinitionException, or using a log-and-rethrow?


Affects: 3.0.4

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions