flow icon indicating copy to clipboard operation
flow copied to clipboard

SpringInstantiator is not honoring @Primary annotation

Open mlopezFC opened this issue 11 months ago • 4 comments

Description of the bug

If I have two I18NProviders as spring beans and one of them is using @Primary annotation, SpringInstantiator will refuse using it and will fall back to the default behavior. The message shown in the log is: "The number of beans implementing 'I18NProvider' is 2. Cannot use Spring beans for I18N, falling back to the default behavior"

Expected behavior

SpringInstantiator should use the one marked with the @Primary annotation

Minimal reproducible example

Create a Vaadin-Spring application with two I18N providers and mark one of them with @Primary annotation. Sample project: spring-instantiator-issue.zip

Versions

  • Vaadin / Flow version: Vaadin 24.3.6
  • Java version: 17
  • OS version: Any

mlopezFC avatar Mar 07 '24 16:03 mlopezFC