t8y2/dbx · error · IllegalArgumentException

Unsupported object type: null

Error message

Unsupported object type: null

What it means

FirebirdAgent.normalizeObjectSourceType only supports "PROCEDURE"; a null object type cannot be normalized, so it throws IllegalArgumentException immediately. The check exists so the agent never silently treats an unknown object kind as a procedure.

Source

Thrown at agents/drivers/firebird/src/main/java/com/dbx/agent/firebird/FirebirdAgent.java:123

                        } else if (parameterType == 1) {
                            outputs.add(parameter);
                        } else {
                            throw new IllegalStateException("Unsupported Firebird parameter type: " + parameterType);
                        }
                    }
                }
            }

            String source = !found || body == null || body.isBlank()
                ? ""
                : buildProcedureDdl(name, inputs, outputs, body);
            return new ObjectSource(name, normalizedType, schema, source, false);
        });
    }

    static String normalizeObjectSourceType(String objectType) {
        if (objectType == null) {
            throw new IllegalArgumentException("Unsupported object type: null");
        }
        String normalized = objectType.trim().toUpperCase(Locale.ROOT);
        if (!"PROCEDURE".equals(normalized)) {
            throw new IllegalArgumentException("Unsupported object type: " + objectType);
        }
        return normalized;
    }

    private static String buildProcedureDdl(
        String name,
        List<ProcedureParameter> inputs,
        List<ProcedureParameter> outputs,
        String body
    ) {
        StringBuilder ddl = new StringBuilder("CREATE OR ALTER PROCEDURE ")
            .append(quoteIdentifier(name));
        appendParameterBlock(ddl, inputs, " (");
        if (inputs.isEmpty()) {

View on GitHub (pinned to c0390bff16)

Solutions

  1. Pass objectType = "PROCEDURE" explicitly — Firebird in this driver only supports procedures.
  2. Handle null upstream: default or skip objects whose type is unknown before calling getObjectSource.
  3. If the object really is a table/function, use the appropriate agent/API instead of the Firebird procedure source path.
  4. Trim and uppercase the type value on your side before the call if it comes from external metadata.

Example fix

// before
agent.getObjectSource(conn, schema, name, row.getObjectType()); // may be null
// after
String type = row.getObjectType();
if (type == null || !type.trim().equalsIgnoreCase("PROCEDURE")) return; // skip unsupported
agent.getObjectSource(conn, schema, name, type);
Defensive patterns

Strategy: type-guard

Validate before calling

// Java (caller side)
if (objectType == null || !objectType.trim().equalsIgnoreCase("PROCEDURE")) {
    return Optional.empty(); // Firebird agent only supports procedures
}

Type guard

// Java narrowing helper
static boolean isProcedure(String objectType) {
    return objectType != null && "PROCEDURE".equals(objectType.trim().toUpperCase(Locale.ROOT));
}
if (isProcedure(objectType)) {
    src = agent.getObjectSource(conn, schema, name, objectType);
}

Try / catch

try {
    src = agent.getObjectSource(conn, schema, name, objectType);
} catch (IllegalArgumentException e) {
    if (e.getMessage() != null && e.getMessage().startsWith("Unsupported object type")) {
        LOG.debug("Skipping Firebird object {} of type {}", name, objectType);
    } else { throw e; }
}

Prevention

When it happens

Trigger: Calling getObjectSource (or normalizedType) on Firebird with objectType == null; also thrown when a non-null type trims/uppercases to something other than PROCEDURE.

Common situations: Object type coming from an upstream catalog where the type column is NULL for Firebird; callers passing "TABLE" or "FUNCTION" instead of the only supported "PROCEDURE"; lowercase or whitespace variants that would otherwise work but are null-checked first.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/059a9a1de2b9b75e. Report an issue: GitHub.