Skip to content

Document autowiring of javax.validation.Validator with use of @EnableWebMvc [SPR-12194] #16808

@spring-projects-issues

Description

@spring-projects-issues

Andy Wilkinson opened SPR-12194 and commented

I'm seeing some strange behaviour with @EnableWebMvc and autowiring of javax.validation.Validator.

When there's no explicitly-configured LocalValidatorFactoryBean, auto-wiring of javax.validation.Validator fails as no matching bean is found. When there's a single explicitly-configured LocalValidatorFactoryBean, auto-wiring fails as there are now two matching beans: the explicitly configured one and the one that's provided by @EnableWebMvc.

I'll open a Spring Framework Issues PR with some code to reproduce both behaviours.


Affects: 4.0.7, 4.1 GA

Reference URL: spring-projects/spring-boot#1539

3 votes, 9 watchers

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions