Beanutils.copyProperties 异常一: No origin bean specified
Beanutils.copyProperties 异常二: No destination bean specified
Beanutils.copyProperties的源码:
public void copyProperties(Object dest, Object orig) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
if (dest == null) {
throw new IllegalArgumentException("No destination bean specified"); //没有目的bean指定
}
if (orig == null) {
throw new IllegalArgumentException("No origin bean specified");//没有起源bean指定
}
......}
通过源码我们可以了解到public void copyProperties(Object dest, Object orig)方法的两个参数值为NULL就会报出上面两个错误。