No value specified for Date

现象

  使用BeanUtils复制对象属性,结果抛出No value specified for Date异常。

原因

  是数据源orig有一个参数是java.util.Date类型,没有初始化值,调用了BeanUtils.copyProperties方法。

解决办法

  在使用方法之前执行

1 ConvertUtils.register(new DateConverter(null), java.util.Date.class);

  完美解决。

原文地址:https://www.cnblogs.com/guanghe/p/11060619.html