2014년 2월 24일 월요일

BeanUtils.copyProperties사용 할 때 copyProperties() throws a ConversionException : No value specified 발생 처리

BeanUtils.copyProperties(targetVO, vo); 사용시 copyProperties() throws a ConversionException : No value specified  발생할 경우 대상 vo객체에 Date, Timestamp가 있을 경우 오류가 발생한다.

이럴때는 아래와 같이 지정해주면 된다.

BeanUtilsBean beanUtilsBean = BeanUtilsBean.getInstance();
beanUtilsBean.getConvertUtils().register(new org.apache.commons.beanutils.converters.SqlTimestampConverter(null), java.sql.Timestamp.class);
BeanUtils.copyProperties(eventEnrollVO, enrollVO);

댓글 없음:

댓글 쓰기