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 ...
随机推荐
- Protege4.3使用入门(二)
1.支持OWLViz 利用OWLViz查看我们构建Class的结构图.如果尚未安装,请到http://www.graphviz.org/pub/graphviz/stable/windows/grap ...
- SerialPort缓冲区
SerialPort缓冲区中有:接收缓冲区,发送缓冲区,输入缓冲区,输出缓冲区,传输缓冲区. 例如: 串口属性:BytesToRead(获取接收缓冲区中数据的字节数)--这里提到的是“接收缓冲区” 串 ...
- leetcode524
public class Solution { public string FindLongestWord(string s, IList<string> d) { string long ...
- Asp.Net framework 类库 自带的缓存 HttpRuntime.Cache HttpContext.Cache
两个Cache 在.NET运用中经常用到缓存(Cache)对象.有HttpContext.Current.Cache以及HttpRuntime.Cache,HttpRuntime.Cache是应用程序 ...
- Hibernate 实体对象三种状态 :自由,持久,游离
实体对象的状态及转化: 有了上面关于Hibernate缓存的知识,我们再来介绍实体对象的状态就非常容易理解了. A:自由态对象: 当我们通过Java的new关键字来生成一个实体对象时,这时这个实体对象 ...
- CXF动态客户端如何优化JaxWsDynamicClientFactory.createClient -- 慢
在CXF动态创建客户端时,如下: JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance(); Client ...
- Perl 变量:标量变量、数组变量、哈希变量和变量上下文
一.Perl 变量变量是存储在内存中的数据,创建一个变量即会在内存上开辟一个空间.解释器会根据变量的类型来决定其在内存中的存储空间,因此你可以为变量分配不同的数据类型,如整型.浮点型.字符串等.上一章 ...
- Unity3D Asset 导入&导出
[Unity3D Asset 导入&导出] 通过Assets->Export Package..菜单可以导出当前选中Assets.若没有选中Assets,则会导出全部assets. 在弹 ...
- 06-Location详解之精准匹配
之前nginx不是编译过吗?现在重新make install一下. 刚刚这个是我们新安装的.原始版的nginx,配置文件比较少,便于我们做调试. 试试精准匹配的概念. 匹配的是/.优先匹配这个最精准的 ...
- 22-Two(公共子序列的个数)
http://acm.hdu.edu.cn/showproblem.php?pid=5791 Two Time Limit: 2000/1000 MS (Java/Others) Memory ...