flowable/flowable-engine · error · FlowableException

Error writing app model to json

Error message

Error writing app model  to json

What it means

FlowableException (wrapping the Jackson cause) thrown by AppResourceConverterImpl.convertAppModelToJson when the given AppModel cannot be serialized to a JSON string. The message includes the model's key (possibly blank) to identify which model failed.

Source

Thrown at modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/deployer/AppResourceConverterImpl.java:43

    public AppResourceConverterImpl(ObjectMapper objectMapper) {
        this.objectMapper = objectMapper;
    }

    @Override
    public AppModel convertAppResourceToModel(byte[] appResourceBytes) {
        try {
            return objectMapper.readValue(appResourceBytes, BaseAppModel.class);
        } catch (Exception e) {
            throw new FlowableException("Error reading app resource", e);
        }
    }

    @Override
    public String convertAppModelToJson(AppModel appModel) {
        try {
            return objectMapper.writeValueAsString(appModel);
        } catch (Exception e) {
            throw new FlowableException("Error writing app model " + appModel.getKey() + " to json", e);
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Check the wrapped cause for the exact Jackson failure
  2. Fix or annotate the offending field in the model (add @JsonIgnore, Serializable types, or a custom serializer)
  3. Ensure you construct/obtain the AppModel via the app engine API rather than hand-building it
  4. If using a custom subclass, verify all getters return Jackson-serializable values

Example fix

// before
class MyAppModel extends BaseAppModel { private transient Object weirdField; /* getter exposed */ }
// after
class MyAppModel extends BaseAppModel {
    @JsonIgnore
    public Object getWeirdField() { return weirdField; }
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
    String json = converter.convertAppModelToJson(model);
} catch (FlowableException e) {
    logger.error("Failed to serialize app model '" + model.getKey() + "'", e.getCause());
    throw e;
}

Prevention

When it happens

Trigger: Calling convertAppModelToJson with a model whose structure Jackson cannot write — e.g. custom AppModel implementation exposing unserializable types, self-referencing structures, or invalid property values.

Common situations: Extending BaseAppModel with a field of a non-serializable type and not disabling FAIL_ON_EMPTY_BEANS or adding serializers; cyclic references in model metadata; passing a null/garbage model built programmatically.

Understand the failure class

Background: "JSON serialization failed", "not JSON serializable", "Failed to serialize": why JSON marshaling errors happen and how to fix them — this error's family across 46 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/5e7ff9108af36bf4. Report an issue: GitHub.