问题
嗨,我有一个工作正常的项目(mvn clean install
并正在运行)。
但是,intelli-J 提示数据源的 Autowiring 存在问题:
Could not autowire. There is more than one bean of
DataSource
type.
然而,实际的 bean 本身似乎是 spring 基础设施的一部分。
有什么想法吗?
屏幕截图
最佳答案
如您所见
Could not autowire. There is more than one bean of DataSourcetype.
您的应用程序上下文中存在多个 bean。在这种情况下,您可以使用 @Qualifier("nameOfNeededBean") 显式指定要 Autowiring 哪一个。这显然是一个intellij问题。
关于java - False 无法 Autowiring Intellij 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46359996/