Error creating bean with name 'dateSource' defined in file 错误信息
问题的原因:
在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 错误信息的更多相关文章
- 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 ...
- 解决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. ...
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'statisticalMapper' defined in file
::, [localhost-startStop-1] DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFact ...
- Error creating bean with name 'XXX' defined in file
这个错误是我在之前操作时,错将另一个dubbo服务器也加载到了该dubbo服务器上(pom.xml),所以出现了Error creating bean with name 'XXX' defined ...
- 严重: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'goodsController' defined in file [D:\eclipse\eclipse-space\pinyougou_parent\pinyou
由于错误太宽,没法截取完整的,所以不怎么连贯,但是不影响错误的解决. 这个错误是因为service无法自动注入.显示嵌套状态异常. 我就查看了一下我的坐标和配置文件,配置文件的路径和访问地址都是正确的 ...
- 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 ...
- 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 ...
- 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 ...
- 异常将上下文初始化事件发送到类的侦听器实例.[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 ...
随机推荐
- IDEA实用的第三方插件和工具介绍设置
一:grep console grep-console插件可以让idea显示多颜色调试日志,使Log4j配置输出的不同级别error warn info debug fatal显示不同颜色 开发起来区 ...
- 自定义ListView里面的Item的内容
我们不可能满足只是往每个item里面填字就足够,像QQ的好友列表就是一个ListView,每个Item里面有头像.名字啊.签名什么的,内容丰富.那我们要怎么定义一个内容丰富的item呢? 要用到Ada ...
- <正则吃饺子> :关于redis集群的搭建、集群测试、搭建中遇到的问题总结
项目中使用了redis ,对于其基本的使用,相对简单些,根据项目中已经提供的工具就可以实现基本的功能,但是只是这样的话,对于redis还是太肤浅,甚至刚开始时候,集群.多节点.主从是什么,他们之间是什 ...
- js处理小数加减时精度失真
最近公司业务有用js处理数据加减,但有时候会出现很多位小数:后来发现是js处理小数时精度失真:为了后边不在犯类似错误,笔者觉得有必要记录下处理方法,当然处理方法有很多种,这里笔者找了一种较为简洁的方法 ...
- pl/sql的to_char和to_date
今天同事让笔者将sql查询出来的时间转换为指定格式的字符串,笔者当时懵逼了,印象中记得有处理过,但就是一时想不起来了,等处理了这个问题后,笔者觉得有必要记录一下,毕竟不知道这个是很掉面子的事不是?好了 ...
- laravel的模型关联之(一对多的反向)
一对多的反向 一对多的反向就相当于,一个用户有多篇文章,但是在显示文章模型的时候你又想显示这个用户的用户名,但是你只有用户id, 这时候就用到了一对多的反向,你用用户(User)模型里面定义了一对多来 ...
- Linux服务器防火墙白名单设置
公司最近对网络安全抓的比较严,要求防火墙必须开启,但是项目的服务器有五六台,三台用于负载均衡,服务器之间必须要进行各种连接,那就只能通过添加白名单的方式. 登上服务器,编辑防火墙配置文件 vi /et ...
- shell 别名alias
在这说下 shell 命令 alias 别名 看个人爱好 设置. 直接执行命令 显示当前所有别名 alias 别名='新的别名' 该命令在当窗口关闭以后 会失效 想要永久生效 需要在 ...
- ajax load事件
ajax.load 使用ajax 来改变div元素文本. load( url [, data][, callback] ) load()方法的传递方式根据参数data来自动指定.如果没有参数传递,则 ...
- c++ 指向类成员函数的函数指针
// ConsoleApplication34.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <iostream& ...