Hi guys, I have this defined in my application c...
# spring
z
Hi guys, I have this defined in my application class (Spring boot + Kotlin):
Copy code
@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.
Copy code
import javax.sql.DataSource