问题的原因:

  在web项目中搭建SSM框架,启动Tomcat时出现错误信息

    有配置文件:applicationContext-mybatis.xml (Spring配置)

          spring-servlet.xml(SpringMVC配置)

          mybatis-config.xml(Mybatis配置)

          log4j.properties

          jdbc.properties

截取部分错误信息片段:

- (1912 ms) - [ERROR] 2016-08-30 22:48:02,924 org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dateSource' defined in file [D:\Program Files\apache-tomcat-8.0.33\apache-tomcat-8.0.33\webapps\springmvcproject-test\WEB-INF\classes\applicationContext-mybatis.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'driver' of bean class [org.apache.commons.dbcp.BasicDataSource]: Bean property 'driver' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1423)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)

尝试过的办法有:

  更换数据源的配置

  更换jdbc.properties

  重写applicationContext-mybatis.xml

  清空Tomcat所在目录下的work文件夹与webapps文件夹

  更换过jar包

  但错误依旧。。。。。

  最后,将Spring配置文件applicationContext-mybatis.xml的名称

        改为  application-mybatis.xml

    错误消失!!!

错误原因:

    初步认为是其他web项目下有同名的Spring配置文件applicationContext-mybatis.xml,

  在启动Tomcat时造成混淆。

    考虑到之前清空过Tomcat目录下的work文件夹与webapps文件夹,

  所以,暂时推断为Tomcat缓存中的残余。

    由于我也在学习Java的时期中,所以还需要研究,关于Tomcat缓存并不了解,

  如果有牛人路过,希望留下指点,感激不尽。

Error creating bean with name 'dateSource' defined in file 错误信息的更多相关文章

  1. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cardSalDao' defined in file [E:\GItUp\pointerCard+redis\target\gameCard-1.0-SNAPSHOT\WEB-INF\classes\cn\jbit\dao

    错误信息: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cardSa ...

  2. 解决Error creating bean with name 'huayuanjingguanDaoimp' defined in file [D:\apache-tomcat-7.0.52\webapps\landscapings\WEB-INF\classes\com\itheima\landscaping\dao\imp\huayuanjingguanDaoimp.class]: Invo

    问题描述: 10:23:13,585 ERROR ContextLoader:307 - Context initialization failedorg.springframework.beans. ...

  3. org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'statisticalMapper' defined in file

    ::, [localhost-startStop-1] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFact ...

  4. Error creating bean with name 'XXX' defined in file

    这个错误是我在之前操作时,错将另一个dubbo服务器也加载到了该dubbo服务器上(pom.xml),所以出现了Error creating bean with name 'XXX' defined ...

  5. 严重: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'goodsController' defined in file [D:\eclipse\eclipse-space\pinyougou_parent\pinyou

    由于错误太宽,没法截取完整的,所以不怎么连贯,但是不影响错误的解决. 这个错误是因为service无法自动注入.显示嵌套状态异常. 我就查看了一下我的坐标和配置文件,配置文件的路径和访问地址都是正确的 ...

  6. Error creating bean with name 'mapper' defined in class path resource [applicationcontext.xml]: Cannot resolve reference to bean 'factory' while setting bean property 'sqlSessionFactory'; nested excep

    Error creating bean with name 'mapper' defined in class path resource [applicationcontext.xml]: Cann ...

  7. Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; neste

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto ...

  8. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisConnectionFactory' defined in class path resource

    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'r ...

  9. 异常将上下文初始化事件发送到类的侦听器实例.[org.springframework.web.context.ContextLoaderListener] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class p

    严重: 异常将上下文初始化事件发送到类的侦听器实例.[org.springframework.web.context.ContextLoaderListener]org.springframework ...

随机推荐

  1. HTTP之报文

    HTTP 报文 用于 HTTP 协议交互的信息被称为 HTTP 报文.请求端(客户端)的 HTTP 报文叫做请求报文,响应端(服务器端)的叫做响应报文.HTTP 报文本身是由多行(用 CR+LF 作换 ...

  2. 【转】3D图形引擎(DX9): FX

    做图形程序已经很多年了,积累了一些经验.来这个论坛也有好几年了,遇到问题的时候,也会在这里发帖子问,也很感谢大家的回答与帮助,希望能多认识一些朋友,大家多交流.分享.做这款项目也有蛮多年了,终于上线了 ...

  3. MySQL中TRUNCATE和ROUND函数的用法

    一.TRUNCATE(expr, int_expr)用法 TRUNCATE函数将expr按照int_expr长度在小数点后按照位数直接进行截取. 实例: ); 输出结果:200.1256 二.ROUN ...

  4. 【282】◀▶ arcpy.mapping 常用函数说明

    arcpy.mapping 教程入门 arcpy.mapping 指导原则 按字母顺序排序的 arcpy.mpping 类列表 按字母顺序排序的 arcpy.mpping 函数列表 按字母顺序排序的 ...

  5. 【原创】9. MYSQL++中的Field、FieldNames以及FieldTypes类型

    mysqlpp::Field其实使用的并不多,主要在于Result.h中ResultBase以及他的派生类型(UseQueryResult和StoreQueryResult)的几个获取下一个field ...

  6. DataSet、DataTable转换List(泛型集合与DataSet互相转换 )

    using System.Data; using System.Reflection; using System.Collections; using System.Collections.Gener ...

  7. c++多线程编程(一)

    C++本身并没有提供任何多线程机制,但是在windows下,我们可以调用SDK win32 api来编写多线程的程序,下面就此简单的讲一下: 创建线程的函数 HANDLE CreateThread( ...

  8. PHP配置数据库XML文件

    <?php $doc=new DOMDocument('1.0','utf-8'); //new一个dom对象 $doc->load("config.xml"); 加载 ...

  9. 客户端级别的渲染分析工具 dynaTrace

    dynaTrace Ajax Edition是一款很好的javaScript性能分析工具.目前支持IE和Firefox 2款浏览器. dynaTrace如图所示: 点击Click here to st ...

  10. pip指定安装包版本

    pip是目前最好用的python包关系工具,没有之一. 1.版本范围符号:==.>=.<=.>.<. 2.单个安装示例: 1 2 3 pip install cchardet  ...