Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.liuyang.JDbCTemplate.PersonDao]: No default constructor fo

错误是说我的配置文件中没有对构造函数进行配置,所以找不到构造函数,在配置文件application.xml中加入如下句子:

         <bean id="personDao" class="com.liuyang.JDbCTemplate.PersonDao">

                          <constructor-arg index="0" ref="dataSource"></constructor-arg>

          </bean>

绿字部分是重点!!!

原文地址:https://www.cnblogs.com/liuyangfirst/p/6051174.html