SpringMVC中上下文初始化失败(Context initialization failed)。具体如下

尼古拉斯__赵四 2016-06-06 05:27:35
Error creating bean with name 'doctorController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'docService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'doctorDAO': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ds' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 5): Field or property 'driver' cannot be found on object of type 'java.util.Properties'
...全文
15615 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
蜡筆尛賢 2018-01-15
  • 打赏
  • 举报
回复
2018-01-15 22:10:55,163 ERROR - Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in class path resource [spring-mybatis.xml]: Could not resolve placeholder 'driverClassName' in string value "${driverClassName}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'driverClassName' in string value "${driverClassName}" 我的报这个错,哪位大神帮忙下
  • 打赏
  • 举报
回复
引用 4 楼 xiaofanku 的回复:
我说的配置文件有误是指: Field or property 'driver' cannot be found on object of type 'java.util.Properties 创建 datasource时加载的依赖无法满足。你从dao层往 前的注入环肯定会报错了
嗯,我是在配置中和MySQL没有连上,把'$'符号写成了'#';还有一个原因是:已经使用了注解加入bean,还在配置文件中重复配置bean。我回复的比较慢,请见谅! 非常的谢谢您!
  • 打赏
  • 举报
回复
是的,基本出的错都是 Error creating bean with name '***' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception isXXXXXXX。 自己没看出来,请问怎么解决?
街头小贩 2016-06-07
  • 打赏
  • 举报
回复
我说的配置文件有误是指: Field or property 'driver' cannot be found on object of type 'java.util.Properties 创建 datasource时加载的依赖无法满足。你从dao层往 前的注入环肯定会报错了
街头小贩 2016-06-07
  • 打赏
  • 举报
回复
贴一下你的applicationContext.xml我瞧瞧,web.xml中设置加载applicationContext.xml文件了吧!
街头小贩 2016-06-06
  • 打赏
  • 举报
回复
应该是配置文件有误

10,606

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 其他
社区管理员
  • 其他
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧