{"record":{"id":"79c76f8bb048754c","repo":"flowable/flowable-engine","slug":"could-not-find-a-app-model-json-with-id-appdefin","errorCode":null,"errorMessage":"Could not find a app model json with id '<appDefinitionId>","messagePattern":"Could not find a app model json with id '<appDefinitionId>","errorType":"http","errorClass":"FlowableObjectNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppModelResource.java","lineNumber":64,"sourceCode":"            @ApiResponse(code = 200, message = \"Indicates the app model was found returned.\"),\n            @ApiResponse(code = 404, message = \"Indicates the app model was not found.\")\n    })\n    @GetMapping(value = \"/app-repository/app-definitions/{appDefinitionId}/model\", produces = \"application/json\")\n    public String getModelJsonResource(@ApiParam(name = \"appDefinitionId\") @PathVariable String appDefinitionId) {\n        AppDefinition appDefinition = appRepositoryService.getAppDefinition(appDefinitionId);\n\n        if (appDefinition == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find an app definition with id '\" + appDefinitionId + \"'.\", AppDefinition.class);\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessAppDefinitionInfoById(appDefinition);\n        }\n        \n        String appModelJson = appRepositoryService.convertAppModelToJson(appDefinitionId);\n\n        if (appModelJson == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a app model json with id '\" + appDefinitionId);\n        }\n\n        return appModelJson;\n    }\n}\n","sourceCodeStart":46,"sourceCodeEnd":70,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppModelResource.java#L46-L70","documentation":"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.","triggerScenarios":"GET /app-repository/app-definitions/{appDefinitionId}/model where the underlying app model resource is missing/corrupted in the repository for an otherwise resolvable appDefinitionId.","commonSituations":"Deployment whose model resource was removed from ACT_GE_BYTEARRAY, database corruption, manual data cleanup that deleted the model blob but not the definition.","solutions":["Re-deploy the app archive so the model JSON is regenerated","Inspect the deployment resources to confirm the model resource exists","Restore the database entry or redeploy from source artifact"],"exampleFix":"// before: definition exists but model blob missing -> 404\n// after\n// redeploy\nAppDeployment deployment = appRepositoryService.createDeployment()\n    .addClasspathResource(\"my-app.app.zip\").deploy();\nGET /app-repository/app-definitions/<newId>/model  -> 200","handlingStrategy":"try-catch","validationCode":"if (appRepositoryService.createAppDefinitionQuery().appDefinitionId(id).singleResult() == null) return;\n// then also verify the model resource exists in the deployment resources","typeGuard":null,"tryCatchPattern":"try { ... } catch (FlowableObjectNotFoundException e) { log.error(\"Model JSON missing for {}\", id); return ResponseEntity.status(404).build(); }","preventionTips":["Avoid manual cleanup of ACT_GE_BYTEARRAY rows","Re-deploy apps whose model blobs are suspect","Verify deployment resource lists include the model JSON"],"tags":["rest","flowable","not-found"],"backgroundTag":"entity-not-found","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"}