这个错误是说我的启动失败了。这类问题要从配置文件中开始找原因,我用的是spring框架,所以我从application.中找的原因

然后对比路径,对比文件的命名和id,都没有问题,为什么会在启动的时候找不到dataSource,我想到应该是少包,但是,找寻发现包也没有问题。

最后发现是这里错了

这里是重点:::!!!!!

我的getter和setter的方法中设置的dateSource,而配置文件想要注入的是dataSource,两个名称不一致,难怪机器找不到我的文件的class,更改

<bean id="dataSource" destroy-method="close"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
</bean>

<bean id="personDao" class="com.liuyang.jdbc.PersonDao">
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean>

这里所有的dataSource为dateSource,或者更改类中的名称,dateSource为dataSource,连同getter和setter一起才有效。

Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'dataSource' of bean class [com.liuyang.jdbc.PersonDao]: No property 'dataSource的更多相关文章

  1. Spring MVC集成thymeleaf时提示:defined in ServletContext resource [/WEB-INF/SrpingMVCTest-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException

    错误提示: defined in ServletContext resource [/WEB-INF/SrpingMVCTest-servlet.xml]: Instantiation of bean ...

  2. 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" clas ...

  3. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'supplierAction': Injection of resource dependencies failed; nested exception is org.springframework.beans.factor

    这个错误是因为抽象Action类的时候,把ServletContext写成了serverContext,导致无法注入,正确写法是 import javax.annotation.Resource; i ...

  4. org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.jboss.resteasy.plug

    之前做的项目是resteasy的上传,代码没有问题,断点都不进来呢. 我以为可以直接移植到SpringMVC,但是SpringMVC不支持MultipartFormDataInput , 用Multi ...

  5. Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'URIType' of bean class

    查阅了资料原始JDK的问题.解决方法 1.重新安装JDK为1.7版本 2.修改配置 1.webx的依赖改为3.1.6版: <dependency> <groupId>com.a ...

  6. Error creating bean with name 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0': Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework

    昨晚在 使用spring aop, 然后Tomcat启动的时候, 报了这么个错: Caused by: org.springframework.beans.factory.BeanCreationEx ...

  7. nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException

    You should autowire interface AbstractManager instead of class MailManager. If you have different im ...

  8. Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyExce

    Error setting property values ; nested exception is org.springframework.beans.NotWritablePropertyExc ...

  9. Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeExcep

    body { font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI ...

随机推荐

  1. Spring mvc RequestContextHolder分析

    转载: http://blog.csdn.net/zzy7075/article/details/53559902

  2. bat 笔记 一

    echo 有两个参数 off 和 on 注意echo前面要加个@才生效 当 @echo off的时候就是将doc命令将前面的路径去掉,默认其实就是@echo on显示路径: 默认的状态: 输入@ech ...

  3. 五种方法实现Java的Singleton单例模式

    面试的时候经常会问到Java的单例模式,这道题能很好的考察候选人对知识点的理解程度.单例模式要求在系统运行时,只存在唯一的一个实例对象. 下面我们来详细剖析一下其中的关键知识点,并介绍五种实现方法,以 ...

  4. Redis基本操作-string

    Redis的5种数据结构:string.list.hash.set和zset; Redis 所有的数据结构都是以唯一的 key 字符串作为名称,然后通过这个唯一 key 值来获取相应的 value 数 ...

  5. 在客户端浏览器中点击下载生成excel

    生成excel的样式,里面的数据已经写好,使用apache,poi来写的. 1.首先是controller /** *下载服务结构体Excel * *@return */ @RequestMappin ...

  6. 【干货】国外程序员整理的 C++ 资源大全(转)

    转zi:http://www.csdn.net/article/2014-10-24/2822269-c++ 关于 C++ 框架.库和资源的一些汇总列表,由 fffaraz发起和维护. 内容包括:标准 ...

  7. MySQL修改编码设置及乱码问题

    源地址:http://blog.csdn.net/millia/article/details/5806774   昨天尝试把自己用php编写的第一个糙站发布到网上..结果出现了因为编码不统一而导致乱 ...

  8. 关于Integer的比较,今天又犯了一个低级错误,记录下

    今天查看以前所写的代码,看到有一部分被人改了,代码如下: if (orgId != organizationUpdateReq.getOrgId()) { //orgId的类型为Integer,org ...

  9. 吴裕雄 数据挖掘与分析案例实战(15)——DBSCAN与层次聚类分析

    # 导入第三方模块import pandas as pdimport numpy as npimport matplotlib.pyplot as pltimport seaborn as snsfr ...

  10. 让IIS支持PHP的配置步骤

    本文转自:http://marsren.blog.51cto.com/116511/41199/ 在Windows Server 2003的IIS6下配置ISAPI方式的PHP,配置方法是,在IIS的 ...