Skip to content

DataSource FailureAnalyzer wrongly assumes that only auto-configuration can throw a DataSourceBeanCreationException #12947

@PingGao89

Description

@PingGao89

hi
application.properties has configured spring.datasource.url value in src/main/resources,Startup class configuration:

@SpringBootApplication
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class}) 
@ComponentScan
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

Run, throw Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-configured

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions