Skip to content

PlaceholderConfigurerSupport.doProcessProperties() loses stack trace on exception [SPR-11346] #15970

@spring-projects-issues

Description

@spring-projects-issues

Jim Yingst opened SPR-11346 and commented

In org.springframework.beans.factory.config.PlaceholderConfigurerSupport, the doProcessProperties() method contains the following code:

try {
         visitor.visitBeanDefinition(bd);
}
catch (Exception ex) {
         throw new BeanDefinitionStoreException(bd.getResourceDescription(), curName, ex.getMessage());
}

This effectively loses all stack trace information for the original exception, ex. Other than the getMessage(), which may or may not be useful. It would be easy to change this to properly set the nested cause so as to preserve this information:

throw new BeanDefinitionStoreException(bd.getResourceDescription(), curName, ex.getMessage(), ex);

Affects: 3.2.6

Referenced from: commits 8d304ef, fdd31c0

Backported to: 3.2.7

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions