ziad
07/07/2017, 5:34 PM@Bean
fun init(dataSource: DataSource) = CommandLineRunner {
//Do things with DataSource
}
Intellij gives me a warning: “Could not autowire. There is more than one bean of ‘DataSource’ type.”
I’m trying to understand what to do about this. I’m particularly confused because of the following:
1) This compiles and runs correctly.
2) If I change the injection to constructor injection rather than injecting into the init function, the IDE stops giving warnings.
3) I have an import statement for DataSource defined, which I assumed would help resolve the ambiguity for the IDE. import javax.sql.DataSource