org.springframework.beans.InvalidPropertyException错误调试

Spring MVC 实体中List长度超过256报错问题 解决 报错信息如下: org.springframework.beans.InvalidPropertyException: Invalid property 'changeList[256]' of bean class [com.weichai.modules.performance.dto.PerformanceIndexForm]: Index of out of bounds in prope... 阅读详情

org.springframework.beans.InvalidPropertyException

org.springframework.beans.InvalidPropertyException错误调试,它是我在写Javaweb项目用ssh,时遇到的错误。

出现这个错误主要原因有以下三点:

1、spring的配置文件中的属性变量名要一致。

2、要加入相应的get/set方法。

3、总是报这错误,仔细检查了配置,又没有问题的。原来好像是spring的命名规定第一个大写字母前必须有不少于2个的小写字母。

注意:要格外注意第3点。

最终我找到了我的错误,是出在string的命名规则:我没有写大写字母,全是小写字母。


//在WEB-INF目录下添加spring配置文件applicationContext.xml,用于注入bean等 ,这一步

//里面的applicationContext.xml的spring注入的name=“ ”写错。

在我写的applicationContext.xml里面改错;

<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">


<bean id="productAction" class="action.ProductAction" scope="prototype">
<property name="productService" ref="productService"></property>
</bean> 


<bean id="productService" class="service.ProductService">
<property name="productDao" ref="productDao"></property>
</bean>
<bean id="productDao" class="dao.ProductDao">
</bean>


</beans>

测试Struts2和Spring框架是否整合成功 
项目右键->Run As->Run on Server,选择好tomcat容器运行。在浏览器地址栏输入:http:localhost:8080/EmployeeManagementSystem/addProduct.jsp 
如果弹出页面: 

这里写图片描述



我的这个项目运行结果:


接口报错500InvalidPropertyException: Invalid property ‘xxx[256]‘,@InitBinder的使用 从报错可以看到,前端传入参数个数大于256个,后端使用List接参,超出数组大小限制。 阅读详情

相关推荐

基于IsaacGym和PPO的四足机器人GO2梅花桩强化学习实战

四足机器人运动控制长期面临复杂地形适应难题,传统模型控制依赖精确建模且计算代价高。强化学习通过智能体与环境交互试错,为动态平衡与自主决策提供新思路。Isaac Gym作为GPU并行仿真平台,可同时运行数千环境,大幅缩短训练周期;PPO算法凭借稳定的更新策略与良好超参数鲁棒性,成为机器人运动技能训练的事实标准。结合宇树GO2机器人模型,通过精心设计奖励函数与域随机化,训练出的策略不仅推理速度快,且具备一定泛化能力。本文聚焦自动机器狗在梅花桩离散支撑面场景中的挑战,完整呈现环境搭建、观测空间定义、奖励设计、训练

weixin_30312563的博客 451

org.springframework.beans.InvalidPropertyException: Invalid property 'datas[0]' of bean class [com.h

org.springframework.beans.InvalidPropertyException: Invalid property 'datas[0]' of bean class [com.hahah.atcrowdfunding.vo.Data]: Index of out of bounds in property path 'datas[0]'; nested exception i...

BugEveryday的博客 6865

不会C# Winform用户界面设计?是因为没有掌握这些控件(建议收藏)

文章目录6.1 常用控件6.1.1 单选按钮(RadioButton)6.1.2 复选框(CheckBox)6.1.3 框架1. 面板控件Panel2. 分组框GroupBox3. TabControl控件6.1.4 应用实例6. 2 列表框和组合框6.2.1 列表框(ListBox)6.2.2 组合框(ComboBox )6.2.3 应用实例6.3 用户交互界面6.3.1 滚动条和进度条6.3.2 定时器6.3.3 菜单设计菜单设计概述MenuStrip和ContextMenuSt

智慧空间实验室 2920

spring boot 提交参数绑定List下标越界,超过256,java.lang.IndexOutOfBoundsException异常

springMVC框架提交参数list时,springmvc默认只能接收到255个数据,当你前台传的数据长度大于255位的时候就会报错 错误信息如下: 2019-05-09 20:44:26.047 ERROR 9284 --- [nio-8090-exec-9] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for se...

无名剑 6879

SAP CPI 和 PO 的区别

SAP CPI适合云集成轻量级的集成需求,并且由于其云架构,具有快速部署低维护高度可扩展的特点。SAP PO更适合本地系统集成复杂的集成场景和高度定制化的需求,并且对于已经有 SAP 基础设施的企业来说,PO 提供了更多的控制和灵活性。选择使用哪个平台通常取决于企业的技术架构、集成需求、预算以及对灵活性和控制的需求。如果企业主要使用 SAP 的本地系统,并且有复杂的集成需求,那么 SAP PO 是一个理想的选择。如果企业更多地依赖云应用,并希望简化集成操作,那么 SAP CPI 更加适合。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1874

2026 企查查/天眼查:IP频率限制 + 验证码策略,企业工商数据采集实战

企业工商数据采集技术解析与解决方案 本文深度剖析了2026年企查查和天眼查平台的反爬机制与技术对抗方案。主要内容包括: 反爬机制分析: 采用JA4+ TLS指纹识别、极验v6验证码等多层防护 IP限制策略严格区分未登录/普通/VIP账号 精准识别并封禁数据中心IP 核心解决方案: 构建高可用住宅代理池,动态轮换真实用户IP 基于YOLOv8的验证码缺口识别技术(准确率99%) 分布式架构设计,支持千万级数据采集 多账号池管理与行为模拟技术 技术亮点: 动态住宅IP池实现1%以下封禁率 Playwright浏

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 1327

org.springframework.beans.InvalidPropertyException: Invalid property 'htd' of bean class [com.dao.im

Caused by: org.springframework.beans.InvalidPropertyException: Invalid property 'htd' of bean class [com.dao.impl.UserDaoImpl]: No property 'htd' found at org.springframework.beans.BeanWrapperImpl.co

learnTech的专栏 6889

手把手教你学BSP(11.3)--BSP实例:基于Raspberry Pi 4 Model B的Linux BSP开发实例

通过以上步骤,我们完成了一个基于Raspberry Pi 4 Model B的Linux BSP开发过程,包括硬件初始化、设备驱动编写、Bootloader配置、内核配置和编译,以及最终映像的生成。每个步骤都非常重要,确保每一步都正确无误才能使整个系统正常运行。

MHD0815的博客 1011

InvalidPropertyException(无效属性异常)可能的原因和解决方法

异常时,查看异常的详细信息以获取更多的上下文。仔细检查涉及到的属性名称、属性类型、初始化操作等,确保它们在当前的上下文和使用场景下是有效的。根据异常信息,逐步排查可能的原因,以便更好地理解和解决问题。表示尝试设置或获取一个无效属性的异常。这通常发生在使用 JavaBean 规范的对象(具有公共 getter 和 setter 方法的对象)时。

Java开源程序猿 2851

Pytorch CIFAR10图像分类 EfficientNet v1篇

EfficientNet源自Google Brain的论文EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks. 从标题也可以看出,这篇论文最主要的创新点是. 论文提出了,混合缩放,把网络缩放的三种方式:深度、宽度、分辨率,组合起来按照一定规则缩放,从而提高网络的效果。EfficientNet在网络变大时效果提升明显,把精度上限进一步提升,成为了当前最强网络。

风信子的猫Redamancy的快乐星球 1852

YOLO+OpenCV强强联手:高精度跌倒检测技术实战解析

(0, 1), (0, 2), (1, 3), (2, 4), # 脖子和头部(3, 5), (5, 6), (5, 7), (7, 9), (5,11),# 左臂(4,6), (6, 12), (6,8) ,(8,10),# 右臂(11, 12), (11, 13), (13, 15), #左腿(12, 14), (14, 16) #右腿keypoints是检测到的人体关键点数据,frame是图像帧,boxes是检测到的边界框信息。定义了人体关键点之间的连接关系,用于绘制人体骨架。

yolo模型训练找我,AI游戏合作找我 2314

InvalidPropertyException: Invalid property 'emp[accountName]' of bean class [com.ht.vo.NoticeDetailV

JDK1.7+Tomcat7.0+Eclipse+SSM+Bootstrap(含Bootstrap Table) 三月 09, 2019 10:27:52 上午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [SpringMVC] in context wit...

風的博客 7195

AgentScope深入分析-ReActAgent

ReActAgent 是 AgentScope 框架中最核心的智能体实现,它完美诠释了"推理-行动"(Reasoning-Acting)循环的精髓。本文将深入分析 ReActAgent 的类继承关系、核心执行流程,以及状态管理、钩子机制、实时介入等关键技术点。通过阅读本文,你会理解智能体如何与模型交互、如何执行工具、如何处理中断,以及这些机制背后的设计考量。模块化:通过组合不同的组件(模型、格式化器、工具集、记忆)来构建智能体透明性:所有关键流程都对开发者可见,可以精确控制可扩展性。

842

org.springframework.beans.InvalidPropertyException

今天使用spring的时候,突然发现原来spring也有点潜规则啊 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'iAclService' defined in class path resource [bean/pc2.xml]: Initialization ...

sunqi 742

LE AUDIO---Volume Control Service

LE AUDIO---Volume Control Service

weixin_42162924的博客 163

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

org-springframework-beans-NotWritablePropertyException--Invalid property 问题

org-springframework-beans-NotWritablePropertyException--Invalid property  多半是属性的名字不对,可查看源代码的中的名字即可。如果大小写拼写问题。 Could not autowire dao, No qualifying bean of type […] found for dependenc

Trend的博客 7232

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

SpringMVC报错:org.springframework.beans.NotWritablePropertyException: Invalid property 'prefix' of bea

在根据刘增辉老师写的书籍《MyBatis从入门到精通》一书中,学习到MyBatis与Spring整合的地方,遇到一个错误,排查这个错误排查了半天时间,今天特意将其写出来做总结。 错误内容如下: 十一月 09, 2019 4:33:57 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server.服务器版本...

dear_Alice_moon的专栏 1628

spring注入对象错误(org.springframework.beans.NotWritablePropertyException)

org.springframework.beans.NotWritablePropertyException: Invalid property 'postDao' of bean class? 问题原因为:在Spring的applicationContext.xml文件中,使用property依赖注入时失败导致的。 <property name="...."> 中name的名字是与be...

sout 7714

错误提示:org.springframework.beans.NotWritablePropertyException:Invalid property

错误原因:get/set方法写错  java对象中没有把属性进行正常封装的异常,即NotWritablePropertyException 原命名是UserDaoImpl,自己写set方法时写成了setUserDaoImpl,这时只要把原先写好的get/set方法删掉,重新来一遍就好了。...

Fy_Deng的博客 7306

org.springframework.beans.NotWritablePropertyException: Invalid property... 问题解决

组合sping和struts action注入的时候,发生了 org.springframework.beans.NotWritablePropertyException: Invalid property...错误,这是我用属性注入时发生的错误,后来改用构造注入就没这个问题,那为什么会出现这种情况,分析了一下,查了一些网络资料后,发现别人这么说:1、据本人所知,第一个字母是小写,而第二个字母

suger_2007的专栏 9092

Spring org.springframework.beans.InvalidPropertyException

org.springframework.beans.InvalidPropertyException 1、spring的配置文件中的属性变量名要一致。 2、要加入相应的get/set方法。 3、总是报这错误,仔细检查了配置,又没有问题的。原来好像是spring的命名规定第一个大写字母前必须有不少于2个的小写字母。

每天进步一点点 时间会让你成为巨人 1万+

【Spring】java.lang.IndexOutOfBoundsException: Index: 256, Size: 256

Spring接受前台的数据超过256出现如下异常: org.springframework.beans.InvalidPropertyException: Invalid property 'specificationValues[256]' of bean class [com.sencloud.entity.Specification]: Index of out of bounds i

Draco 1万+

Caused by: org.springframework.beans.NotReadablePropertyException: Invalid property

Caused by: org.springframework.beans.NotReadablePropertyException: Invalid property 'email' of bean class [com.thinkgem.jeesite.modules.sys.entity.User]: Bean property 'email' is not readable or has an invalid getter method: Does the return type of the get

Wind的博客 1420

Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property ‘username ‘

Spring整合mybatis出现错误 Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'username '

qq_56028947的博客 1781
上一篇: Web开发环境搭建 Eclipse-Java EE 篇:来自博客园用户 潘帕斯
下一篇: 日历 java 代码
abcd2333
博客等级 码龄9年 7粉丝 14原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值