Null return value from advice does not match primitive return type for
1、org.springframework.aop.AopInvocationException:Null return value from advice does not match primitive return type for
这个错就是返回的类型不匹配

2、原因:
主要还是基本数据类型无法接受null,如果环绕返回null就报错,可以将boolean改成Boolean。

3、Boolean.TRUE 和 true 区别?
Boolean A(){
return Boolean.TRUE;
}
boolean B(){
return Boolean.TRUE
}
Boolean C(){
return true;
}
boolean D(){
return true;
}
在性能和内存使用效率方面,A、B效率最高,C、D会更慢,因为需要装箱和拆箱。
所以建议 Boolean 返回类型函数建议 return Boolean.TRUE;这种写法!
Null return value from advice does not match primitive return type for的更多相关文章
- delete attempted to return null from a method with a primitive return type (int)
今天被自己给蠢死了 今天在代码中遇到这个错误, 百度翻译一下:映射方法,从一org.system.mapper.child.chmorganizationexaminationmapper.delet ...
- rg.apache.ibatis.binding.BindingException: Mapper method 'com.dao.Cameao.getOnlineDayRation attempted to return null from a method with a primitive return type (float)
本文为博主原创,未经允许不得转载: 异常展示如下: org.apache.ibatis.binding.BindingException: Mapper method 'com.dao.Cameao. ...
- mysql查询null异常:attempted to return null from a method with a primitive return type
select sum(deposit_amount)from tb_commission_ib_day mysql查询时报异常: attempted to return null from a met ...
- Does the parameter type of the setter match the return type of the getter?
JDK 1.8, dubbo-admin版本是2.5.4-SNAPSHOT,tomcat8.5启动,报错: ERROR context.ContextLoader - Context initiali ...
- org.apache.ibatis.binding.BindingException: Mapper method 'attempted to return null from a method with a primitive return type (long).
一.问题描述 今天发现测试环境报出来一个数据库相关的错误 org.apache.ibatis.binding.BindingException: Mapper method 'attempted to ...
- attempted to return null from a method with a primitive return type (int).
java接口文件 package com.cyb.ms.mapper; import org.apache.ibatis.annotations.Param; public interface Acc ...
- Bean property ‘mapperHelper’ is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
spring boot 报错: Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property ...
- Mapper method 'com.xxxx.other.dao.MyDao.getNo attempted to return null from a method with a primitive return type (int)
使用myBatis调用存储过程的返回值,提示错误信息: org.apache.ibatis.binding.BindingException: Mapper method 'com.xxxx.othe ...
- mybatis查询时使用基本数据类型接收报错-attempted to return null from a method with a primitive return type (int)
一.问题由来 自己在查看日志时发现日志中打印了一行错误信息为: 组装已经放养的宠物数据异常--->Mapper method 'applets.user.mapper.xxxMapper.xxx ...
- nested exception is java.lang.IllegalArgumentException: warning no match for this type name: res [Xlint:invalidAbsoluteTypeName]
注:内有单词(sping)写错,请忽略,不影响程序运行 运行时报错: Exception in thread "main" org.springframework.beans.fa ...
随机推荐
- DevOps实战:使用GitLab+Jenkins+Kubernetes(k8s)建立CI/CD解决方案
目录 一.系统环境 二.前言 三.DevOps简介 四.CI/CD简介 五.安装并配置docker参数 六.使用registry搭建镜像仓库 七.安装部署gitlab代码仓库 7.1 创建gitlab ...
- vulnhub_me and my grilfriend
解题步骤 主机nmap扫描,开放22和80端口 访问该ip,发现只能本地访问 查看源代码,提示需要使用x-forwarded-for的请求头,可以在burp suite中每次添加一个请求头,也可以使用 ...
- pandas 根据内容匹配并获取索引
bool = ExcelDataStr.str.contains("Item No./Customer/Saler") # 初始位置:initial position, 终位置:e ...
- AttributeError:module‘win32com.gen_py has no attribute ‘CLSIDToClassMap‘
解决方案如下: 1. 运行如下代码,找到文件所在位置 from win32com.client.gencache import EnsureDispatch import sys xl = Ensur ...
- 华为ensp配置静态路由,三路由,三pc
华为ensp配置静态路由 目的:使pc1,pc2,pc3能相互ping通 1,tuop图的搭建 1,如图所示:先搭建好设备的通讯关系,在标记好每台设备对应的,ip地址和网关. 2,pc的网关,与ip地 ...
- 清理MySQL的binlog历史文件
前言 系统版本:centos 7 MySQL版本:5.7 mysql的binlog文件最好不要手动删,避免删错导致bin log同步异常. 步骤 查看当前的binlog文件 show binary l ...
- Gin中间件开发
Gin是一个用Go语言编写的Web框架,它提供了一种简单的方式来创建HTTP路由和处理HTTP请求.中间件是Gin框架中的一个重要概念,它可以用来处理HTTP请求和响应,或者在处理请求之前和之后执行一 ...
- 8、Mybatis之自定义映射
8.1.环境搭建 8.1.1.创建新module 创建名为mybatis_resultMap的新module,过程参考5.1节 8.1.2.创建t_emp和t_dept表 CREATE TABLE ` ...
- HTML一键打包APK工具1.9.5更新,新增一机一码功能
HMTL网址打包APK,可以把本地HTML项目, Egret游戏,网页游戏,或者网站打包为一个安卓应用APK文件,无需编写任何代码,也无需配置安卓开发环境,支持在最新的安卓设备上安装运行. 打包软件会 ...
- 基于Spring事务的可靠异步调用实践
SpringTxAsync组件是仓储平台组(WMS6)自主研发的一个专门用于解决可靠异步调用问题的组件. 通过使用SpringTxAsync组件,我们成功地解决了在仓储平台(WMS6)中的异步调用需求 ...