1、java.lang.ClassCastException: com.chenggutek.iou.rest.modular.comm.entity.MsgUser cannot be cast to (转换异常)com.baomidou.mybatisplus.plugins.Page

    at com.sun.proxy.$Proxy90.getPageMsgTrade(Unknown Source) ~[na:na]

 

2、org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'app_user_id' not found. Available parameters are [appUserId, param1]

原因:xml文件中,param参数错误,不对应和Mapper.java

 

3、org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2(结果应该为一个,但是却查到了两个)

    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77) ~[mybatis-spring-1.3.1.jar:1.3.1]

 

4、org.springframework.dao.TransientDataAccessResourceException:

### Error updating database.  Cause: java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed

### The error may involve com.chenggutek.iou.rest.modular.pay.dao.PayOrderMapper.insert-Inline

### The error occurred while setting parameters

### SQL: INSERT INTO tbl_pay_order   ( trade_id )  VALUES   ( ? )

### Cause: java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed

; SQL []; Connection is read-only. Queries leading to data modification are not allowed; nested exception is java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed

今天更新数据时出现这个错误:

java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed

原因:我在service层设置了只读。@Transactional(readOnly = true)

而更新的方法没有把可读设置为FALSE。解决办法是在方法上加上readOnly=FALSE

注解如下:    @Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)

 

5、Required request body is missing :public org.springframework.http.ResponseEntity ……

原因:没有传参

 

6、.m.m.a.ExceptionHandlerExceptionResolver : Resolved exception caused by Handler execution: org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "undefined"

原因:调用的方法id对不上号,js错误