使用Spring提供的BeanUtils.copyProperties()方法报错:Could not copy property 'xxx' from source to target
来源:互联网 发布:mybatis动态sql详解 编辑:程序博客网 时间:2024/06/06 05:03
使用Spring提供的BeanUtils.copyProperties()方法报错:Could not copy property 'xxx' from source to target; nested exception is java.lang.IllegalArgumentException调用的方法:org.springframework.beans.BeanUtils.copyProperties(Object source, Object target) 报错:org.springframework.beans.FatalBeanException: Could not copy property 'adgroupId' from source to target; nested exception is java.lang.IllegalArgumentException at org.springframework.beans.BeanUtils.copyProperties(BeanUtils.java:615) at org.springframework.beans.BeanUtils.copyProperties(BeanUtils.java:528) ... 分析:在使用Spring提供的BeanUtils.copyProperties(Object source, Object target)方法时,如果target中的属性含有基本类型,而source中对应的属性值为null,则copy时,就相当于给一个基本类型赋值null,故报错。解决方法:javaBean的属性类型使用包装类型,不要使用基本类型。
阅读全文
0 0
- 使用Spring提供的BeanUtils.copyProperties()方法报错:Could not copy property 'xxx' from source to target
- Could not copy property 'id' from source to target异常
- Could not copy properties from source to target异常解决
- BeanUtils.copyProperties(source, target)用法
- BeanUtils.copyProperties(source, target)用法
- 重写org.springframework.beans.BeanUtils的copyProperties(Object source,Object target)方法 从model复制属性到pojo中
- 关于BeanUtils.copyProperties( )方法的使用
- BeanUtils中copyProperties()方法的使用
- BeanUtils.copyProperties()的使用
- Spring BeanUtils.copyProperties使用心得
- spring的BeanUtils.copyProperties用法
- Spring的BeanUtils.copyProperties用法
- spring的BeanUtils.copyProperties用法
- spring的BeanUtils.copyProperties用法
- 警告:[SetPropertiesRule]Setting property 'source' to xxx did not find a matching property.的消除
- commons-beanutils的copyProperties方法
- commons-beanutils的copyProperties方法
- Could not transfer artifact xxx from/to xxx解决方案
- 开门大吉
- P1605 迷宫
- 用户文件下载服务解决方案
- protobuf转json
- Spring mvc拦截器+angular js拦截器 做用户登录拦截控制
- 使用Spring提供的BeanUtils.copyProperties()方法报错:Could not copy property 'xxx' from source to target
- ArrayList
- Java不可变对象
- 如何绕过CDN找源站ip?
- 解決org.quartz.JobPersistenceException: Couldn't acquire next trigger: Couldn't retrieve trigger: null
- windows中搭载openssl环境
- 理解点击事件的事件分发过程
- 如何配置idea使一个窗口包含多个工程
- P地址,网关,子网掩码,网段