flowable/flowable-engine · error · FlowableException

Error reading app resource

Error message

Error reading app resource

What it means

AppResourceConverterImpl deserializes an .app resource (JSON) into an AppModel via Jackson. Any exception from objectMapper.readValue is wrapped and rethrown as FlowableException("Error reading app resource"). It indicates the app resource bytes are not valid JSON or do not match the AppModel schema.

Source

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

import org.flowable.engine.app.AppResourceConverter;

import tools.jackson.databind.ObjectMapper;

public class AppResourceConverterImpl implements AppResourceConverter {

    protected ObjectMapper objectMapper;

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

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

        return appModel;
    }

}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Validate the .app resource is well-formed JSON (e.g. with a JSON parser) before deploying; inspect the wrapped cause 'e' for the exact parse error and offset.
  2. Re-export the app model from Flowable Modeler/UI instead of hand-editing the JSON.
  3. Check that the file is the app resource (JSON) and not a BPMN XML or other artifact.
  4. If caused by a version upgrade, regenerate/upgrade the app resource to match the current AppModel schema.

Example fix

// before
byte[] bytes = Files.readAllBytes(path); // possibly wrong file
repositoryService.createDeployment().addBytes("my.app", bytes).deploy();
// after
String json = new String(Files.readAllBytes(path), StandardCharsets.UTF_8);
new ObjectMapper().readTree(json); // sanity check: throws if not valid JSON
repositoryService.createDeployment().addBytes("my.app", json.getBytes(StandardCharsets.UTF_8)).deploy();
Defensive patterns

Strategy: validation

Validate before calling

try {
    new ObjectMapper().readTree(new String(appResourceBytes, StandardCharsets.UTF_8));
} catch (IOException e) {
    throw new IllegalArgumentException("App resource is not valid JSON", e);
}
// then convert
appResourceConverter.convertAppResourceToModel(appResourceBytes);

Try / catch

try {
    AppModel model = converter.convertAppResourceToModel(bytes);
} catch (FlowableException e) {
    log.error("Invalid app resource JSON", e.getCause()); // inspect cause for parser details
}

Prevention

When it happens

Trigger: Calling RepositoryService.deploy(...) with a corrupted/truncated .app file, or AppResourceConverterImpl.convertAppResourceToModel(byte[]) with bytes that are not valid JSON or whose fields mismatch AppModel.

Common situations: Uploading an app export that was hand-edited and became invalid JSON; uploading a wrong file type (e.g. a BPMN XML or zip instead of the app JSON); character-encoding corruption during download; schema drift between Flowable versions (AppModel fields renamed).

Related errors


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