问题的原因:

  在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. HIVE UDF

    基本函数 SHOW FUNCTIONS; DESCRIBE FUNCTION <function_name>; 日期函数 返回值类型 名称 描述 string from_unixtime( ...

  2. RabbitMQ操作方法

    /// <summary> /// 消费者(消息) /// </summary> public class CustmerMq { /// <summary> // ...

  3. ffmpeg码率控制

    一.VBR与CBR的含义和区别 VBR是动态码率.CBR是静态码率. VBR(Variable Bitrate)动态比特率.也就是没有固定的比特率,压缩软件在压缩时根据音频数据即时确定使用什么比特率, ...

  4. 负载均衡LVS之DR(附:NFS共享存储) 五分钟搭建手册

    一:DR-模式 调度器Ip:192.168.1.254 服务器ip:192.168.1.1/192.168.1.2 VIP:192.168.1.10 ——配置负载均衡调度器: 关闭重定向响应配置: V ...

  5. undefined&nbsp;reference&nbsp;to…

    照着GUN/Linux编程指南中的一个例子输入编译,结果出现如下错误: undefined reference to 'pthread_create' undefined reference to ' ...

  6. 页面布局 frameset元素

    frameset.html: <!DOCTYPE html><html lang="en"><head> <meta charset=&q ...

  7. qt数据库有效插件为空的情况

    打了一周的环境,从ubuntu到win7,搭建环境的时间比写代码的时间都多.先简单的介绍一下我搭建的环境不是纯QT环境,是一个芬兰的软件开发商开发出来的SDK里面完全融合qt,其中qt是以单独的目录存 ...

  8. Setting up an OpenGL development environment in ubuntu

    1.opening terminal window and entering the apt-get command for the packages: sudo apt-get install me ...

  9. 一个可用模板的Xml描述

    <?xml version="1.0" encoding="utf-8"?> <VMTEMPLATE> <ID>48< ...

  10. Linux内核的特征

    Linux内核的特征 Linux是个人计算机和工作站上的Unix类操作系统.但是,它绝不是简化的Unix.相反,Linux是强有力和具有创新意义的Unix类操作系统.它不仅继承了Unix的特征,而且在 ...