Java报错:Error creating bean with name 'testController': Injection of resource dependencies failed
报错如下:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bookRepository' defined in com.sirifeng.testjpa.Mapper.BookRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Cannot resolve reference to bean 'jpaMappingContext' while setting bean property 'mappingContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMappingContext': Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
我吐了,de了两个小时的bug,最后发现是数据库的url的一个参数写错了,我写的
spring.datasource.url=jdbc:mysql://localhost:3306/webstore?useUnicode=true&characterEncoding=utf-8&serverTimeZone=UTC
这里的serverTimeZone,写错了,应该是serverTimezone,Z写成大写了,跟这报错没有半毛线关系,对新手来说真的太不友好了啊!!!!
所以写代码的时候,特别是这种配置文件的,一定要仔细检查!!!
最新文章
- CouchDB简介
- visual studio2015使用git管理源代码
- 【CMD】日常总结
- ionic + cordova 配置和开发过程中的一些问题
- [转] Linux下防火墙iptables用法规则详及其防火墙配置
- Linux 怎么把自己写的脚本添加到服务里面,即可以使用service命令来调用
- hdu 2060
- bzoj1406
- 调用支付宝接口Android客户端没有支付宝APP的情况下解决无法调用支付宝页面的问题
- Android中attr自定义属性详解
- Ubuntu常用命令与技巧
- IO调度算法研究1
- Python正则表达式,统计分析nginx访问日志
- b.控制结构
- Python模块configparser(操作配置文件ini)
- 微软Telnet的回显功能开启
- GlusterFS群集存储项目
- 关于casperjs的wait方法的执行顺序
- android调试debug快捷键
- python 继承与多重继承
热门文章
- 顺序表的插入和删除(基于c语言)
- 《前端运维》一、Linux基础--07Shell函数
- MyEclipse 在浏览器运行里报错,The requested resourse (xx/index.jsp) is not available
- 如何在MySQL中增加一列
- Netty之DefaultAttributeMap与AttributeKey的机制和原理
- Mysql学习笔记-临键锁实验
- uoj310【UNR #2】黎明前的巧克力(FWT)
- AFO以后的机房游记
- Zookeeper 的典型应用场景 ?
- Hashmap如何同步?