Skip to content

Spring boot cannot start with two or more DataSources #5104

Closed
@quaso

Description

@quaso

DataSourceInitializer init method fails, because it works only if there is just one DataSource bean in the context>

if (this.applicationContext.getBeanNamesForType(DataSource.class, false, false).length > 0) { this.dataSource = this.applicationContext.getBean(DataSource.class); }

Either change condition in if clause to "== 0" or handle org.springframework.beans.factory.NoUniqueBeanDefinitionException prope

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions