dbeaver/dbeaver · error · IllegalStateException
No suitable DataExporterArrayFormat found
Error message
No suitable DataExporterArrayFormat found
What it means
Thrown by DataExporterArrayFormat.getArrayFormat(String) when no enum constant matches the supplied bracket pair. The enum only supports [], {}, and (). It compares the first char against each prefix and the last char against each suffix; if none match it throws IllegalStateException (an unchecked exception).
Source
Thrown at plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/stream/exporter/DataExporterArrayFormat.java:39
CURLY_BRACKETS('{', '}'),
BRACKETS('(', ')');
private char prefix;
private char suffix;
DataExporterArrayFormat(char prefix, char suffix) {
this.prefix = prefix;
this.suffix = suffix;
}
public static DataExporterArrayFormat getArrayFormat(String bracketPair) {
for (DataExporterArrayFormat df : DataExporterArrayFormat.values()) {
bracketPair = bracketPair.trim();
if (bracketPair.charAt(0) == df.prefix && bracketPair.charAt(bracketPair.length() - 1) == df.suffix) {
return df;
}
}
throw new IllegalStateException("No suitable DataExporterArrayFormat found");
}
public static DataExporterArrayFormat getArrayFormatOnPrefix(char prefix) {
for (DataExporterArrayFormat df : DataExporterArrayFormat.values()) {
if (prefix == df.prefix) {
return df;
}
}
return CURLY_BRACKETS;
}
public char getPrefix() {
return prefix;
}
public char getSuffix() {
return suffix;
}View on GitHub (pinned to 1e5ee1042b)
Solutions
- Use one of the supported pairs: [], {}, or ().
- Trim/validate the bracket-pair string before passing it to getArrayFormat.
- Prefer getArrayFormatOnPrefix(char) which defaults to CURLY_BRACKETS instead of throwing.
- If a custom pair is required, extend the enum or handle the format outside this helper.
Example fix
// before
DataExporterArrayFormat fmt = DataExporterArrayFormat.getArrayFormat(userInput);
// after: validate against the known set first
String pair = userInput.trim();
if (pair.length() < 2 || "[]{}()".indexOf(pair.charAt(0)) < 0) {
fmt = DataExporterArrayFormat.CURLY_BRACKETS; // safe default
} else {
fmt = DataExporterArrayFormat.getArrayFormat(pair);
} Defensive patterns
Strategy: type-guard
Validate before calling
String pair = bracketPair == null ? "" : bracketPair.trim();
boolean ok = pair.length() >= 2 && switch (pair.charAt(0) + "" + pair.charAt(pair.length()-1)) {
case "[]", "{}", "()" -> true; default -> false;
};
if (!ok) throw new IllegalArgumentException("Unsupported bracket pair: " + pair); Type guard
static boolean isSupportedBracketPair(String p) {
if (p == null) return false;
p = p.trim();
return p.length() >= 2 && (p.startsWith("[") && p.endsWith("]")
|| p.startsWith("{") && p.endsWith("}")
|| p.startsWith("(") && p.endsWith(")"));
} Try / catch
try {
fmt = DataExporterArrayFormat.getArrayFormat(userInput);
} catch (IllegalStateException e) {
fmt = DataExporterArrayFormat.CURLY_BRACKETS; // safe default
log.warn("Unsupported bracket pair, defaulting to {}", e);
} Prevention
- Restrict user input to [], {}, ().
- Prefer getArrayFormatOnPrefix which never throws.
- Validate the bracket-pair string before calling getArrayFormat.
When it happens
Trigger: getArrayFormat(bracketPair) is called with a string whose first/last characters are not one of [ ], { }, ( ). The loop finds no match and throws new IllegalStateException("No suitable DataExporterArrayFormat found").
Common situations: User or config supplied a custom bracket pair like <> or "" or an empty/whitespace string; a malformed array-format property in the exporter settings; copy-paste of an unsupported delimiter.
Related errors
- Separator cant start with Quote. Separator: [%s] Quote [%s]
- Can't initialize data exporter
- `type` attribute is mandatory
- Can't find processor of type '{type}'
- Can not determine target container
AI-assisted analysis of dbeaver/dbeaver@1e5ee1042b (2026-08-13).
Data as JSON: /api/errors/d4b9b8e4859b2621.
Report an issue: GitHub.