org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'productCode

SpringBoot踩坑记录:@Cacheable报错EL1007E: Property or field 'code' cannot be found on null 背景 最近在微服务项目开发中,两个服务的接口使用 @Cacheable 做缓存处理,一个正常运行,另一个接口一直报错,报错信息如下: org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'code' cannot be found on null at org.spring... 阅读详情

控制台报这个错误,前台不影响显示,也不影响使用...

遇到这个问题,只要在controller层加个判断即可.


之前这样写会报错,不影响使用

@Controller
public class ProductController {
    /**
     * 商品详情页
     * @return
     */
    @RequestMapping(value = "/productDetail/{productCode}", method = RequestMethod.GET)
    public String ProuctDetailView(Model model, @PathVariable("productCode") String productCode){
        ProductDetailVo productDetailVo = productService.selectProductDetailByBackstage(productCode);
        if (productDetailVo!=null){
            model.addAttribute("productDetailVo",productDetailVo );
        }
        return "admin/product/product_detail";
    }
改成( 加个else new一个新的就不报错 )

@Controller
public class ProductController {
    /**
     * 商品详情页
     * @return
     */
    @RequestMapping(value = "/productDetail/{productCode}", method = RequestMethod.GET)
    public String ProuctDetailView(Model model, @PathVariable("productCode") String productCode){
        ProductDetailVo productDetailVo = productService.selectProductDetailByBackstage(productCode);
        if (productDetailVo!=null){
            model.addAttribute("productDetailVo",productDetailVo );
        }else {
            model.addAttribute("productDetailVo",new ProductDetailVo());
        }
        return "admin/product/product_detail";
    }

LLC混合滞回控制 vs 电压模/电流模:UCC25640x仿真对比与选型指南 在开关电源设计中,LLC谐振变换器的环路补偿是核心难点。传统电压模控制(VMC)和电流模控制(CMC)在LLC拓扑上存在环路增益漂移、动态响应慢等局限。混合滞回控制通过滞回比较器直接调制开关频率,并融合输出电压与谐振腔电流信息,实现了自适应环路增益和快速瞬态响应。该技术显著提升轻载效率与动态性能,适用于高密度适配器、快充及车载充电机等场景。本文基于UCC25640x系列,通过仿真对比三种控制策略,为工程选型与调试提供实践参考。 阅读详情

相关推荐

Ubuntu 20.04下Cube-Studio云原生平台单机部署全攻略(附避坑指南)

本文详细介绍了在Ubuntu 20.04系统上单机部署Cube-Studio云原生平台的完整流程,包括环境准备、Docker配置、Rancher与Kubernetes集群部署以及Cube-Studio核心组件安装。特别提供了官方文档未涵盖的实战技巧和常见问题解决方案,帮助开发者高效完成部署并避免常见陷阱。

weixin_29313423的博客 474

org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or...

CachePut与Cacheable 今天做修改的时候,错误加了加了注解Cacheable,结果报错,网上一直说①后台传到前端的对象里没有xxxxx属性②前端取属性xxxxx的名字写错了,所以取值不到,反复比对,终于明白,修改的时候找不到缓存里的键所以报错 org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'stuId' cannot be found on null a...

ZHWPCSDN的博客 7381

Alphafold2/multimer本地安装避坑指南:从Conda环境配置到GPU加速实战

本文详细介绍了Alphafold2/multimer本地安装的全流程,从Conda环境配置到GPU加速实战,特别针对常见的报错处理提供了解决方案。通过硬件环境检查、依赖安装技巧、OpenMM补丁应用等步骤,帮助研究人员高效部署蛋白质结构预测工具,提升计算效率。

weixin_29309213的博客 122

org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'roleId' can

报错提示: org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'roleId' cannot be found on null 错误发生在删除角色时,原因是删除角色的方法上写了@CacheEvict(key = "#role.roleId") 一般情况下.@Cach...

Amy的博客 1万+

银河麒麟v10-arm SEALOS离线部署k8s集群(v1.22.8)

示例 如果你想保存一个名为 "my_snapshot" 的 etcd 快照到指定的对象路径你可以使用以下命令: sealos etcd save --backupPath /root --name my_snapshot 如果文件名带时间戳:my_snapshot$(date +"%Y%m%d_%H%M%S") 会生成一个形如 20230913_143045 的时间戳。--restorePath string:指定快照恢复目录(默认为 "/opt/sealos/etcd-restore")。

xjudt的博客 3303

ABAP动态填充Word模板:基于cl_docx_document的XML替换方案

本文详细介绍了ABAP中基于cl_docx_document类的动态Word模板填充方案。该方案通过直接操作DOCX文件的XML核心,完美解决了传统OLE/DOI方法在格式保真、性能和后台运行方面的痛点,是实现复杂、批量Word文档生成的优雅解决方案。

gpt4scribbler的博客 530

spel.SpelEvaluationException: EL1007E: Property or field ‘cabinId‘ cannot be found on null

Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'cabinId' cannot be found on null at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:213) ~[spri

weixin_41843972的博客 3837

多标签学习模型(一):Multi Label Knn

1.什么是多标签分类问题 2.传统的KNN算法 3.为什么传统的KNN算法不能够处理多标签问题 4.ML KNN的推导 5.ML KNN是如何解决多标签问题的 6.总结

weixin_42892235的博客 2615

redis缓存报错---org.springframework.expression.spel.SpelEvaluationException: EL1008E:

org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field 'categoryId' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpressionRootObject' - maybe not public or not valid?

不知名小人物的博客 2965

手把手教你学simulink(26.7)--控制算法场景示例:基于模型预测控制(MPC)的智能温室环境控制系统

首先,我们需要将温室环境的动力学模型转换为状态空间形式。假设我们有四个状态变量:温度 TT、湿度 HH、光照强度 II 和二氧化碳浓度 CCO2CCO2​,以及四个控制输入:加热器功率 u1u1​、加湿器加湿量 u2u2​、通风扇风速 u3u3​ 和补光灯光照强度 u4u4​。状态空间模型可以表示为:x(t)=[T(t),H(t),I(t),CCO2(t)]Tx(t)=[T(t),H(t),I(t),CCO2​(t)]T 是状态向量。

MHD0815的博客 409

AIGC游戏开发:如何评估生成内容的玩家满意度?

如何量化评估生成内容对玩家体验的影响?本文聚焦AIGC生成的游戏内容(包括但不限于剧情、关卡、NPC对话、道具),系统探讨玩家满意度的评估方法论,覆盖主观与客观评估、静态与动态内容、短期与长期体验等场景。核心概念:定义AIGC与玩家满意度的关联维度;评估方法:主观(问卷/访谈)与客观(行为/生理数据)评估的技术细节;数学模型:构建多指标融合的评估模型;实战案例:以AIGC生成关卡为例,演示从数据采集到模型落地的全流程;工具资源:推荐数据采集、分析与建模的工具链;

AI天才研究院 1228

报错:EL1007E: Property or field 'name' cannot be found on null

SpringBoot集成thymeleaf做开发遇到的错误 Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field ‘name’ cannot be found on null 详细信息: org.thymeleaf.exceptions.Templ...

smileKutper的博客 2万+

【RT-DETR创新改进】改进前必看!对Ultralytics调参, 1:1还原RT-DETR官方版本实验参数,使用原汁原味的RT-DETR模型,才能高效跑实验、高效涨点、收割小论文、完成大论文!!!

本文针对Ultralytics训练RT-DETR精度不佳问题,提供参数配置优化方案。通过对比官方RT-DETR参数设置,详细指导如何修改Ultralytics版本的关键参数,包括优化器、学习率、权重衰减等6处配置调整。操作步骤涵盖default.yaml文件修改和trainer.py代码调整,确保模型收敛性能达到官方水平,帮助研究者快速提升实验效果。文末附官方源码链接和具体参数配置网址供参考。

Ai缝合怪、助力小伙伴高效发论文 1800

springBoot thymeleaf 属性为空时报错:EL1007E

================================ ©Copyright 蕃薯耀2021-12-01 ​​​​​​蕃薯耀的博客_CSDN博客 一、报错的主要信息: org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'id' cannot be found on null 二、Html模板页面 <input type="hidden" n...

蕃薯耀的博客 2940

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

【spring data jpa】使用jpa的@Query,自己写的语句,报错:org.springframework.expression.spel.SpelEvaluationException:...

报错: org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'status' cannot be found on null 如果检查 自己写的SQL语句完全没有问题的情况下,并且已经使用了@Param(value ="") 那么你需要注意,@Param()这个注解引入的...

weixin_34099526的博客 1545

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

springboot 异常 org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or fiel

org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field 'timestamp' cannot be found on object of type 'java.util.HashMap' - maybe not public? 使用LauItachi的项目WeChatPlatf...

xuqi1029的博客 3万+

vb 6.0并口开发操作实例

vb6并口开发,简体中文,试例内有inpout32.dll动态链接库

解决 EL1007E: Property or field ‘dl‘ cannot be found on null

本地使用idea启动的服务测试没有问题,但是服务器上面出现EL1007E: Property or field ‘dl’ cannot be found on null,检查代码是使用@CacheEvict (@Cacheable也应是同一情况) 出现的问题。通过开启 -parameters 参数来解决上面的问题,但是服务器上面这个方法不是最优解,但,实际上取不到,所以报错了。

懒 虫的博客 2447

报错EL1007E: Property or field ‘xxxxx’ cannot be found on null原因竟是这

报错EL1007E: Property or field ‘xxxxx’ cannot be found on null 是什么原因? 有时我们发现Springboot项目前端的 thymleaf 会报这样的错 EL1007E: Property or field ‘xxxxx’ cannot be found on null 这是因为: 后台传到前端的对象里没有xxxxx属性 前端取属性xxxxx的名字写错了,所以取值不到 ...

qq_2105837402的博客 1万+

with root cause org.springframework.expression.spel.SpelEvaluationException* field ‘records‘ cannot

1、 前言 1.1 idae中spring boot项目使用thymeleaf模板,前端HTML页面获取后台Controller中的Model存放的数据 1.2 项目在登录后跳转到后台显示查询到数据库数据的页面(首先是还没有查询,需要进入页面后点击按钮才去查询并显示) 1.3 这里就直接报错误了,最开始我只能通过把查询到的数据显示到页面(就是刚刚登录成功,就跳转去查询数据)的方式解决错误,后面我发现一个好玩的方法,在这里介绍一下。 2、 错误信息 2.1主要错误 2021-11-20 20:40:36.53

qq_43987149的博客 1903

EL1008E: Property or field ‘setmeal‘ cannot be found on object of type ‘org.springframework.cache.in

org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field ‘setmeal’ cannot be found on object of type ‘org.springframework.cache.interceptor.CacheExpressionRootObject’ - maybe not public or not valid? at org.springframework.ex

xujunming668的博客 3123

Thymeleaf踩雷之SpelEvaluationException: EL1007E: Property or field 'data' canno be found on null

问题:在使用Thymeleaf模板引擎绑定controller传来的对象时,报了个EL1007E的error ! 控制台错误关键截取: Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'data' cannot be found on null...

Escorts的博客 1万+

IDEA报错:Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or

后端写好之后,写前端,出现了报错: 在页面上跳转之后是报错误500: 意思是找不到workerName这些属性 这部分属性全部是在entity实体类里面写了,确认并没有拼写错。页面提醒: 突然想到,在前端这里 看似调用的是water的属性,实际上调用的是它的get方法,如getWorkerName()/getcustDetails()等,但是我在做这个项目的时候一直没有手动写这个方法,原因是我使用了插件lombok,使用这个插件应添加注解 就会自动生成set/get方法了,此时红色波浪线消失,项目无

llap_wyx的博客 4041

Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field ‘

用map保存两个page类时,可能会报如下错 Caused by: org.attoparser.ParseException: Exception evaluating SpringEL expression: "product.epFileName" (template: "index" - line 65, col 13) Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating Spri

呼吸困难的acm小白的博客 2634

SpelEvaluationException: EL1007E: Property or field ‘xxx‘ cannot be found on null解决方案

SpelEvaluationException: EL1007E: Property or field 'xxx' cannot be found on null解决方案 redis缓存的时候参数对象为空 key为null 导致报错 解决方案: 1.删除@Cacheable或@CacheEvict 2.入参前判空

notfound4043的博客 4087

getOutputStream() has already been called

getOutputStream() has already been called for this response

qyvlik的专栏 2764
上一篇: Spring中@Controller和@RestController之间的区别
下一篇: js实现map
ruhang
博客等级 码龄11年 7粉丝 6原创
评论 5
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值