flowable/flowable-engine · error · FlowableObjectNotFoundException

Could not find a app model json with id

Error message

Could not find a app model json with id '<appDefinitionId>

What it means

FlowableObjectNotFoundException thrown when convertAppModelToJson returns null for an app definition that itself exists. The definition row is present but its model JSON (the resource content) could not be produced or found.

Solutions

  1. Re-deploy the app archive so the model JSON is regenerated
  2. Inspect the deployment resources to confirm the model resource exists
  3. Restore the database entry or redeploy from source artifact

Example fix

// before: definition exists but model blob missing -> 404
// after
// redeploy
AppDeployment deployment = appRepositoryService.createDeployment()
    .addClasspathResource("my-app.app.zip").deploy();
GET /app-repository/app-definitions/<newId>/model  -> 200
Defensive patterns

Strategy: try-catch

Validate before calling

if (appRepositoryService.createAppDefinitionQuery().appDefinitionId(id).singleResult() == null) return;
// then also verify the model resource exists in the deployment resources

Try / catch

try { ... } catch (FlowableObjectNotFoundException e) { log.error("Model JSON missing for {}", id); return ResponseEntity.status(404).build(); }

Prevention

When it happens

Trigger: GET /app-repository/app-definitions/{appDefinitionId}/model where the underlying app model resource is missing/corrupted in the repository for an otherwise resolvable appDefinitionId.

Common situations: Deployment whose model resource was removed from ACT_GE_BYTEARRAY, database corruption, manual data cleanup that deleted the model blob but not the definition.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppModelResource.java:64

            @ApiResponse(code = 200, message = "Indicates the app model was found returned."),
            @ApiResponse(code = 404, message = "Indicates the app model was not found.")
    })
    @GetMapping(value = "/app-repository/app-definitions/{appDefinitionId}/model", produces = "application/json")
    public String getModelJsonResource(@ApiParam(name = "appDefinitionId") @PathVariable String appDefinitionId) {
        AppDefinition appDefinition = appRepositoryService.getAppDefinition(appDefinitionId);

        if (appDefinition == null) {
            throw new FlowableObjectNotFoundException("Could not find an app definition with id '" + appDefinitionId + "'.", AppDefinition.class);
        }
        
        if (restApiInterceptor != null) {
            restApiInterceptor.accessAppDefinitionInfoById(appDefinition);
        }
        
        String appModelJson = appRepositoryService.convertAppModelToJson(appDefinitionId);

        if (appModelJson == null) {
            throw new FlowableObjectNotFoundException("Could not find a app model json with id '" + appDefinitionId);
        }

        return appModelJson;
    }
}

View on GitHub (pinned to d6d39ce1c6)