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就會報出上面兩個錯誤。
