微信小程序后台springboot+mybatis+mysql“采坑”集锦
“采坑”错误集锦
1、service层
错误描述:2019-04-14 22:09:52.027 ERROR 8416 --- [nio-8082-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.wechat.springbootleaving.dao.AreaDao.queryArea] with root cause
解决:
service层必须和serviceImpl层放在同一个包下
2、数据库连接池
问题描述:
{"success":false,"errMsg":"Handler dispatch failed; nested exception is java.lang.AbstractMethodError: Method com/mchange/v2/c3p0/impl/NewProxyResultSet.isClosed()Z is abstract"}
解决:
3、扫描不到controller
问题描述:打开localhost:一直报404,连hello,也输不出来
解决:启动类中:MapperScan("dao层路径")
4、数据库时区
问题描述:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone
解决:
5、数据库调不出来
描述:简单hello可以输出,调用数据库出错
{“success”:false,“errMsg”:“嵌套异常是org.apache.ibatis.exceptions.PersistenceException:\ r \ n ###错误查询数据库。原因:org.springframework.jdbc.CannotGetJdbcConnectionException:无法获取JDBC连接;嵌套异常是java.sql.SQLException:无法从底层数据库获取连接!\ r \ n ###文件中可能存在错误[D:\微信小程序参考\微信小程序前后端源码\ zhang-demo-test \ target \ classes \ mapper \ AreaDao.xml] \ r \ n ###错误可能涉及com.imooc.demo1.zhangdemotest.dao.AreaDao.queryArea \ r \ n ###执行查询时发生错误\ r \ n ###原因:org.springframework.jdbc.CannotGetJdbcConnectionException:无法获取JDBC连接;嵌套异常是java.sql.SQLException:无法从中获取连接底层数据库!“}
解决:
6、数据库密码错误
描述:Access denied for user 'root'@'localhost' (using password: YES)
解决:改正mybatis或者jdbc配置中mysql数据库密码,检查数据库是否断开连接
7、web界面显示错误
问题描述:adminsex和asex;adminName和aname;adminDepartment和adepartment重复输出
解决:
Admin实体里面多了asex,aname,adepartment的get和set方法
8、数据显示错误
描述:输出数据为空
解决:
实体的属性名与数据库中属性名不一致
最新文章
- 滚来滚去,滚来滚去...Scroller完全解析
- web app性能大讨论
- js解决IE不支持数组的indexOf()方法
- SpringMVC利用拦截器防止SQL注入
- android 学习随笔二十九(自定义监听 )
- 1、Hadoop架构
- MHA参数 转
- [Ruby on Rails系列]6、一个简单的暗语生成器与解释器(上)
- [Docker] Docker Machine intro
- Angularjs中的嵌套路由ui-router
- javascript设计模式——组合模式
- 用委托(Delegate)的BeginInvoke和EndInvoke方法操作线程
- ORA-12737: Instant Client Light: unsupported server character set CHS16GBK
- angularjs html 转义
- iOS-----------关于UDID
- python操作字符串类型json的注意点
- git图形化界面gitk里中文乱码解决
- Presto 性能优化点
- GIL 全局解释器
- ES6 基础
热门文章
- Python3笔记027 - 6.2 参数传递
- Python Ethical Hacking - TROJANS Analysis(2)
- /dev/mapper/VolGroup00-LogVol00 满了,根目录存储垃圾文件导致磁盘满了
- Logging with ElasticSearch, Kibana, ASP.NET Core and Docker
- three.js 数学方法之Plane
- TeamViewer如何绑定谷歌二次验证码/谷歌身份验证?
- js原型链结构理解
- Docker 入门教程(3)——Dockerfile
- DJANGO-天天生鲜项目从0到1-012-订单-用户订单页面
- 初识Elastic search—附《Elasticsearch权威指南—官方guide的译文》