NationalSecurityAgency/ghidra · error · NoSuchElementException
{}
Error message
{} What it means
Thrown (unchecked NoSuchElementException) by DBCachedObjectStore.getColumnByName() when the requested column name is not found among the store schema's field names (ArrayUtils.indexOf returns -1). The exception's message is the missing name. This is a programmer/config error: the name doesn't match the store's declared schema.
Source
Thrown at Ghidra/Debug/ProposedUtils/src/main/java/ghidra/util/database/DBCachedObjectStore.java:982
return doCreate(table.getKey());
}
catch (IOException e) {
adapter.dbError(e);
return null;
}
}
/**
* Get the column number given a column name
*
* @param name the name
* @return the number (0-up index) for the column
* @throws NoSuchElementException if no column with the given name exists
*/
protected int getColumnByName(String name) {
int index = ArrayUtils.indexOf(schema.getFieldNames(), name);
if (index < 0) {
throw new NoSuchElementException(name);
}
return index;
}
/**
* Get the table index for the given column number
*
* @param <K> the type of the object field for the indexed column
* @param fieldClass the class specifying {@link K}
* @param columnIndex the column number
* @return the index
* @throws IllegalArgumentException if the column has a different type than {@link K}
*/
protected <K> DBCachedObjectIndex<K, T> getIndex(Class<K> fieldClass, int columnIndex) {
if (!ArrayUtils.contains(table.getIndexedColumns(), columnIndex)) {
throw new IllegalArgumentException(
"Column " + schema.getFieldNames()[columnIndex] + " is not indexed");
}View on GitHub (pinned to d5f144c24d)
Solutions
- Validate the name against schema.getFieldNames() before lookup (e.g. Arrays.asList(schema.getFieldNames()).contains(name)).
- Check for typos and exact case in the column name string.
- Confirm you are operating on the correct store/schema (the annotated object class whose fields define the names).
- After schema changes, regenerate/update callers that reference removed or renamed columns.
Example fix
// before
int col = store.getColumnByName("myFeild"); // typo -> NoSuchElementException
// after: validate against the schema first
String name = "myField";
if (!Arrays.asList(store.getSchema().getFieldNames()).contains(name)) {
throw new IllegalArgumentException("unknown column: " + name);
}
int col = store.getColumnByName(name); Defensive patterns
Strategy: validation
Validate before calling
// Validate the column name against the schema first
List<String> names = Arrays.asList(schema.getFieldNames());
if (!names.contains(name)) {
// unknown column; fix typo or use the correct store/schema
} Prevention
- Validate names against schema.getFieldNames() before lookup.
- Watch for typos and case mismatches in column names.
- After schema changes, update callers referencing renamed/removed columns.
When it happens
Trigger: Requesting a column index by a name that isn't a field in the store's schema — typo, stale name after a schema change, querying the wrong store, or a name from a different schema version.
Common situations: Schema evolution where a column was renamed/removed but caller still uses the old name; copy-paste of a column name from another object type; case mismatch; querying a store whose factory was configured with a different annotated object class.
Related errors
- Column {} is not indexed
- Column {} is not of type {}! It is {}
- More than one match
- Given field does not apply to given object type
- Given field does not have the given type: {} != {}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/19651bd2688c9560.
Report an issue: GitHub.