问题描述
尽管我在pom.xml中添加了包含我的GemDaoImpl存储库类的软件包,但它给出了错误:
Parameter 0 of constructor in com.bfm.accounting.portfolio.controller.PortfolioApiController required a bean of type 'com.bfm.app.reporting.gem.dao.impl.GemDaoImpl' that Could not be found.
Action:
Consider defining a bean of type 'com.bfm.app.reporting.gem.dao.impl.GemDaoImpl' in your configuration.
解决方法
尝试在XML的component-scan元素中提及包含GemDaoImpl的软件包
public class TestShape {
public static void main(String[] args){
Shape s1 = new Circle(2.0);
System.out.println(s1.getCircumference());
}
}
或者如果您使用的是基于类的配置,请使用
<context:component-scan base-package="com.mkyong.customer" />