flowable/flowable-engine · error · TypeException
Error setting non null for parameter #${i} with JdbcType ${j
Error message
Error setting non null for parameter #${i} with JdbcType ${jdbcType} . Try setting a different JdbcType for this parameter or a different configuration property. Cause: ${e} What it means
TypeException raised when setting a NON-null String parameter fails in FlowableStringTypeHandler.setParameter: setNonNullParameter threw, and the handler wraps the failure with the parameter index and JdbcType plus a hint to adjust the mapping or configuration. The original exception is the cause.
Source
Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/FlowableStringTypeHandler.java:49
finalJdbcType = JdbcType.VARCHAR;
} else {
finalJdbcType = jdbcType;
}
ps.setNull(i, finalJdbcType.TYPE_CODE);
} else {
ps.setNull(i, Types.NULL);
}
} catch (SQLException e) {
throw new TypeException("Error setting null for parameter #" + i + " with JdbcType " + jdbcType + " . "
+ "Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. "
+ "Cause: " + e, e);
}
} else {
try {
setNonNullParameter(ps, i, parameter, jdbcType);
} catch (Exception e) {
throw new TypeException("Error setting non null for parameter #" + i + " with JdbcType " + jdbcType + " . "
+ "Try setting a different JdbcType for this parameter or a different configuration property. " + "Cause: "
+ e, e);
}
}
}
@Override
public void setNonNullParameter(PreparedStatement ps, int i, String parameter, JdbcType jdbcType) throws SQLException {
ps.setString(i, parameter);
}
@Override
public String getNullableResult(ResultSet rs, String columnName) throws SQLException {
return rs.getString(columnName);
}
@Override
public String getNullableResult(ResultSet rs, int columnIndex) throws SQLException {View on GitHub (pinned to d6d39ce1c6)
Solutions
- Read the cause: length/encoding errors mean enlarging the column or truncating the value.
- Match the jdbcType in the mapping to the actual column type.
- Enable larger types (CLOB/NVARCHAR) or adjust NLS/charset configuration for the driver.
- Update or align the JDBC driver with the database server version.
Example fix
// before
#{longText,jdbcType=VARCHAR}
// after
#{longText,jdbcType=CLOB} // or ALTER TABLE ... MODIFY longText VARCHAR(4000) Defensive patterns
Strategy: try-catch
Validate before calling
if (value != null && value.length() > columnMaxLength) throw new IllegalArgumentException("value exceeds column length"); Try / catch
catch (TypeException e) { if (e.getMessage().startsWith("Error setting non null")) { log.error("bind failed", e.getCause()); /* check length/encoding/jdbcType */ } throw e; } Prevention
- Size columns for worst-case values or use CLOB.
- Match mapping jdbcType to the actual column type.
- Keep JDBC driver and DB server versions aligned.
- Watch charset/collation (utf8mb4 for 4-byte chars).
When it happens
Trigger: Binding an actual (non-null) value where the driver rejects it: value longer than the column (VARCHAR size / ORA-12899), invalid characters or encoding, wrong JdbcType for the column, or the target column is NOT NULL but... value conversion issues in custom SQL.
Common situations: Storing a string longer than the column definition; charset/collation mismatches (e.g. 4-byte UTF-8 into utf8 column); custom mappings with mismatched jdbcType; driver incompatibilities after a DB upgrade.
Understand the failure class
Background: "query failed", "%w: SQL error" — wrapped database query errors in Go libraries explained — this error's family across 3 libraries.
Related errors
- JDBC requires that the JdbcType must be specified for all nu
- Error setting null for parameter #${i} with JdbcType ${jdbcT
- Exception while initializing Database connection
- There are app definitions with key = '' and version = ''
- There are ${count} decision tables with key = '${decisionKey
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/e8232b15a4353f9d.
Report an issue: GitHub.