dbeaver/dbeaver · error · DBCException

Expression property not specified

Error message

Expression property not specified

What it means

Thrown by the expression-based attribute transformer when the options map does not contain an 'expression' key. The transformer uses Apache JEXL3 to evaluate per-attribute formulas during data transfer. Without an expression string there is nothing to evaluate, so getJexlExpression() throws immediately. The expression is only parsed once and cached in the jexlExpression field.

Source

Thrown at plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/transformers/DataTransferTransformerExpression.java:53

 */
public class DataTransferTransformerExpression implements IDataTransferAttributeTransformer {

    private JexlExpression jexlExpression;

    @Override
    public Object transformAttribute(@NotNull DBCSession session, @NotNull DBDAttributeBinding[] dataAttributes, @NotNull Object[] dataRow, @NotNull DBDAttributeBinding attribute, Object attrValue, @NotNull Map<String, Object> options) throws DBException {
        JexlExpression jexlExpression = getJexlExpression(options);

        JexlContext context = new VariablesContext(session, dataAttributes, dataRow);

        return jexlExpression.evaluate(context);
    }

    public JexlExpression getJexlExpression(Map<String, Object> options) throws DBCException {
        if (jexlExpression == null) {
            String expr = JSONUtils.getString(options, "expression");
            if (expr == null) {
                throw new DBCException("Expression property not specified");
            }
            jexlExpression = DBVUtils.parseExpression(expr);
        }

        return jexlExpression;
    }

    private static class VariablesContext implements JexlContext {

        private final DBCSession session;
        private final DBDAttributeBinding[] dataAttributes;
        private final Object[] dataRow;

        public VariablesContext(DBCSession session, DBDAttributeBinding[] dataAttributes, Object[] dataRow) {
            this.session = session;
            this.dataAttributes = dataAttributes;
            this.dataRow = dataRow;
        }

View on GitHub (pinned to 1e5ee1042b)

Solutions

  1. Ensure the options map passed to the transformer contains a non-null 'expression' key with a valid JEXL formula
  2. Reconfigure the attribute transformer in the Data Transfer wizard and fill in the expression field
  3. If configuring programmatically, validate the options map before passing it to transformAttribute()

Example fix

// before — missing expression key
Map<String, Object> options = new HashMap<>();
transformer.transformAttribute(session, attrs, row, attr, null, options);
// throws DBCException: "Expression property not specified"

// after — provide the expression
Map<String, Object> options = new HashMap<>();
options.put("expression", "ROW_NUM * 100 + ID");
transformer.transformAttribute(session, attrs, row, attr, null, options);
Defensive patterns

Strategy: validation

Validate before calling

// Validate options map before invoking the transformer
String expr = JSONUtils.getString(options, "expression");
if (expr == null || expr.isBlank()) {
    throw new IllegalStateException(
        "Expression transformer requires a non-null 'expression' option");
}
transformer.transformAttribute(session, attrs, row, attr, value, options);

Try / catch

try {
    transformer.transformAttribute(session, attrs, row, attr, value, options);
} catch (DBCException e) {
    if (e.getMessage().equals("Expression property not specified")) {
        // configuration error — provide the expression and retry
        options.put("expression", "DEFAULT_VALUE");
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Calling DataTransferTransformerExpression.getJexlExpression() (or transformAttribute()) with an options map where JSONUtils.getString(options, "expression") returns null. This happens when the transformer is configured without providing the expression parameter.

Common situations: Programmatically configuring a DataTransferTransformerExpression without setting the 'expression' option. Corrupted or incomplete task configuration that lost the expression value. User selected the expression transformer in the Data Transfer wizard but left the formula field empty.

Related errors


AI-assisted analysis of dbeaver/dbeaver@1e5ee1042b (2026-08-13). Data as JSON: /api/errors/1914f2aa53518347. Report an issue: GitHub.