t8y2/dbx · error · IllegalArgumentException

Unsupported object type: " + objectType

Error message

Unsupported object type: " + objectType

What it means

After the null check, YashanDB's normalizeObjectSourceType trims/uppercases the type and accepts only "FUNCTION" or "PROCEDURE" — the only object kinds whose source YashanDB can return. All other non-null values throw IllegalArgumentException with the original input embedded in the message.

Source

Thrown at agents/drivers/yashandb/src/main/java/com/dbx/agent/yashandb/YashandbAgent.java:138

                    while (resultSet.next()) {
                        String line = resultSet.getString(1);
                        if (line != null) {
                            source.append(line);
                        }
                    }
                }
            }
            return new ObjectSource(name, normalizedObjectType, schema, source.toString(), false);
        });
    }

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

    public static void main(String[] args) {
        new MultiSessionJsonRpcServer(YashandbAgent::new).run();
    }
}

View on GitHub (pinned to c0390bff16)

Solutions

  1. Request source only for FUNCTION and PROCEDURE objects on YashanDB.
  2. Pre-filter in the caller: only invoke when "FUNCTION".equals(t) || "PROCEDURE".equals(t) after trim/uppercase.
  3. Render a 'source not supported for this object type' state in the UI for other kinds instead of calling the API.

Example fix

// before
var src = agent.getObjectSource(schema, name, "VIEW"); // throws
// after
String t = type == null ? "" : type.trim().toUpperCase(Locale.ROOT);
if (t.equals("FUNCTION") || t.equals("PROCEDURE")) {
    var src = agent.getObjectSource(schema, name, t);
}
Defensive patterns

Strategy: validation

Validate before calling

String t = objectType == null ? "" : objectType.trim().toUpperCase(Locale.ROOT);
if (!t.equals("FUNCTION") && !t.equals("PROCEDURE")) {
    // skip: YashanDB supports source only for functions and procedures
}

Type guard

boolean yashandbSupportsSource(String t) {
    if (t == null) return false;
    String n = t.trim().toUpperCase(Locale.ROOT);
    return n.equals("FUNCTION") || n.equals("PROCEDURE");
}

Try / catch

try {
    source = agent.getObjectSource(schema, name, type);
} catch (IllegalArgumentException e) {
    if (e.getMessage().startsWith("Unsupported object type")) {
        source = ""; // render 'source not available'
    } else throw e;
}

Prevention

When it happens

Trigger: Calling normalizedType/getObjectSource with any type other than FUNCTION or PROCEDURE — e.g. "VIEW", "TRIGGER", "SEQUENCE", "PACKAGE", or unnormalized variants like "procedure " that would be fine after trim (handled) but "PACKAGE" or synonyms are not.

Common situations: Shared UI code written for Oracle-compatible drivers offers 'view source' on all object kinds; a metadata listing includes views/triggers and the explorer requests source for each; types are passed from config or user input without restricting to functions/procedures.

Related errors


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