BeanUtils.setProperty throws exception with value NULL

457 views Asked by At

I am using org.apache.commons.beanutils.BeanUtils.setProperty(bean,name,value). When the value is NULL it throws an exception . Digging inside class what is causing the exception is the ConverterUtilsBean.convert method more specifically the BigDecimalConverter.convert that does not accept null. How can i overcome this issue ?

Thanks in advance. Best regards.

1

There are 1 answers

1
Anthony Bongungu On
ConvertUtilsBean convertUtilsBean = BeanUtilsBean.getInstance().getConvertUtils();
convertUtilsBean.register(false, true, -1);

BeanUtils Copy Properties: Registering ConvertUtils

check this thread out!