Skip to content

Common Extraction Errors

bfemiano edited this page Sep 17, 2012 · 1 revision

Extraction cell contents can produce a number of different errors.

Many of the cellmate error messages are very descriptive such as this one from CellReflector if you attempt to read a value type inconsistent with the provided cell

throw new CellExtractorException("Unable to cast field value as instance of " + type.getName() +
                    ". Found field class of "
                    + field.getType().getName(), e, ErrorType.CLASS_CAST);

It helps to understand the different types of errors listed in ErrorType

  1. CLASS_CAST - this is frequently the result of a mismatch between the declared type in a cell and the type-specific extractor method used. For example: extractor.getStringValue(cell) will throw this error if the cell is IntValueCell
  2. ILLEGAL_ACCESS - error attempting to reflectively access a field. This one is relatively uncommon.
  3. MISSING_FIELD - If trying to access a named auxiliary field that doesn't exist, or you're trying to read the label/value from your cell without the proper Label and Value annotations.
  4. MISSING_ANNOTATION - If you've provided a cell class that is missing the Cell annotation.
  5. MISSING_COLFAM_ON_WRITE - If you're trying to write a cell that is not annotated with ColumnFamily.
  6. NULL_FIELD - Trying to access a null value or auxiliary value reference.
  7. TOO_MANY_FIELDS - Thrown by specific methods that are designed to only return one single matching cell.
  8. UNSUPPORTED_TYPE - Thrown only by the cell reflector method getValueBytesIfPrimative() if attempting to read byte content from a value type that's not String, byte[], int, double or long.
  9. REJECTED_WRITE - Thrown whenever a mutation rejection occured during write.
  10. UNKNOWN_ERROR - An error different from those listed here occurred.