Menu

#50 SqlDataLoaderBean throws NPE when the column has null values

carbon_2.1
open
None
5
2004-05-25
2004-05-25
Anand Raman
No

The sql bean data loader throws a null pointer
exception when the database column has null values for
the cache values.

This is a perfectly acceptable case and the dataloader
shouldnt fail.

Looking into the code, I can see that a logging
statement (which logs information about the value being
retrieved) is throwing this exception.

Here is the offending line of code
if ( log.isTraceEnabled() ) {
log.trace("Bean data loader column name is " +
columnName);
log.trace("Bean data loader attribute name is " +
beanAttributeName);
log.trace("Data type of column is " +
resultSet.getObject(columnName).getClass());
}

~ anand

Discussion


Log in to post a comment.

MongoDB Logo MongoDB