Skip to content

Ignore VaadinServiceInitListener from ServiceLoader if it's also discovered in some other way #531

@Legioth

Description

@Legioth

If you have a VaadinServiceInitListener class defined through META-INF/services/com.vaadin.flow.server.VaadinServiceInitListener and the same class is also e.g. a Spring @Component, then each mechanism will create one instance of that listener and it will be invoked twice which may be quite confusing.

If the same class is discovered through multiple sources, then it should only be used once, and then preferably through e.g. Spring since that mechanism also allows injections and such to work as expected. Rather than just silently ignoring the other occurrence, it might be good to log a warning since the entry in META-INF/services is quite redundant.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions