1. 程式人生 > >springboot初始化報錯: Failed to instantiate [XXX]: Specified class is an interface

springboot初始化報錯: Failed to instantiate [XXX]: Specified class is an interface

org.springframework.beans.BeanInstantiationException: Failed to instantiate [XXX]: Specified class is an interface


今天在工作中返現如下報錯,開始還以為由於粗心缺少註解(博主專案為springboot+mybatis架構,全部用註解配置)

部分報錯如下

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [cn.com.depeng.yan.product.dao.PrpdProductDao]: Specified class is an interface
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:68) ~[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1155) ~[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]
	... 43 common frames omitted

結果並不是,後來發現居然是在別的包中有同名的ysUserDao介面,重新命名後果然好使。但是控制檯報錯也