Skip to content

Configuration class parsing may trigger NoClassDefFoundError for nested classes [SPR-13091] #17682

@spring-projects-issues

Description

@spring-projects-issues

Dave Syer opened SPR-13091 and commented

Interestingly, it's not configuration class parsing itself, it's the fallback isLiteConfigurationCandidate check looking for the presence of @Bean methods on non-@Configuration classes which may fail with a NoClassDefFoundError. Making that check more defensive now allows for ignoring any nested classes which cannot be fully resolved, simply not considering them as configuration class candidates to begin with.

That said, Spring Cloud's ServiceConnectionFactory is a fragile affair in any case, even as a top-level class. Doesn't it drag in all sorts of external dependencies through its method return types? This may work for scenarios where only specific methods are being called but will fail at any general introspection attempt if some dependencies are not actually present...

Juergen


Affects: 4.1.6, 4.2 RC1

Reference URL: spring-cloud/spring-cloud-connectors#88

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions