{"record":{"id":"7b520c1c95c8ef0e","repo":"flowable/flowable-engine","slug":"unknown-variable-type-name-typename-7b520c","errorCode":null,"errorMessage":"unknown variable type name ${typeName}","messagePattern":"unknown variable type name (.+?)","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/db/IbatisVariableTypeHandler.java","lineNumber":50,"sourceCode":"\n    protected VariableTypes variableTypes;\n\n    @Override\n    public VariableType getResult(ResultSet rs, String columnName) throws SQLException {\n        String typeName = rs.getString(columnName);\n        VariableType type = getVariableTypes().getVariableType(typeName);\n        if (type == null && typeName != null) {\n            throw new ActivitiException(\"unknown variable type name \" + typeName);\n        }\n        return type;\n    }\n\n    @Override\n    public VariableType getResult(CallableStatement cs, int columnIndex) throws SQLException {\n        String typeName = cs.getString(columnIndex);\n        VariableType type = getVariableTypes().getVariableType(typeName);\n        if (type == null) {\n            throw new ActivitiException(\"unknown variable type name \" + typeName);\n        }\n        return type;\n    }\n\n    @Override\n    public void setParameter(PreparedStatement ps, int i, VariableType parameter, JdbcType jdbcType) throws SQLException {\n        String typeName = parameter.getTypeName();\n        ps.setString(i, typeName);\n    }\n\n    protected VariableTypes getVariableTypes() {\n        if (variableTypes == null) {\n            variableTypes = Context\n                    .getProcessEngineConfiguration()\n                    .getVariableTypes();\n        }\n        return variableTypes;\n    }","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/db/IbatisVariableTypeHandler.java#L32-L68","documentation":"CallableStatement variant of getResult: reads the variable TYPE_ name from a stored-procedure result column and resolves it against registered VariableTypes. A null resolution (including when the type name itself is null, unlike the ResultSet variant) throws this ActivitiException. It means the stored variable type cannot be mapped to any handler.","triggerScenarios":"Fetching variables through callable statements / stored-procedure result sets when the returned TYPE_ name (or null) does not match any registered VariableType.","commonSituations":"Legacy stored procedures returning variable rows with obsolete type names, missing custom type registration, or rows produced by an incompatible engine version.","solutions":["Register the missing VariableType in the engine configuration so lookups succeed","Check the TYPE_ values returned by the stored procedure and correct/migrate them to known types","Verify the stored procedure returns data written by a compatible engine version"],"exampleFix":"// before\n// custom type 'encrypted-string' rows unreadable\n// after\nconfiguration.setCustomPostVariableTypes(new EncryptedStringType()); // registers 'encrypted-string'","handlingStrategy":"try-catch","validationCode":"// Validate before invoking stored procedures:\nString typeName = callableStmt.getString(colIndex);\nif (typeName == null || engineConfig.getVariableTypes().getVariableType(typeName) == null) {\n  throw new IllegalStateException(\"Stored procedure returned unknown variable type: \" + typeName);\n}","typeGuard":"boolean isKnownVariableType(ProcessEngineConfiguration cfg, String typeName) {\n  return typeName != null && cfg.getVariableTypes().getVariableType(typeName) != null;\n}","tryCatchPattern":"try {\n  result = executeProcedureAndGetVariables();\n} catch (ActivitiException e) {\n  if (e.getMessage().startsWith(\"unknown variable type name\")) {\n    logger.error(\"Procedure returned variable with unregistered TYPE_\", e);\n  }\n  throw e;\n}","preventionTips":["Keep stored procedures in sync with the engine's supported variable types","Re-register custom VariableTypes in every engine configuration/environment","Audit TYPE_ values in variable tables after engine version changes"],"tags":["database","variables","stored-procedure","type"],"backgroundTag":"type-mismatch","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}