{"record":{"id":"b701114f5afe9a67","repo":"flowable/flowable-engine","slug":"resource-resourcename-is-not-available","errorCode":null,"errorMessage":"resource '${resourceName}' is not available","messagePattern":"resource '(.+?)' is not available","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"critical","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/AbstractSqlScriptBasedDbSchemaManager.java","lineNumber":230,"sourceCode":"    \n    public String getResourceForDbOperation(String directory, String operation, String component, String databaseType) {\n        return getResourcesRootDirectory() + directory + \"/flowable.\" + databaseType + \".\" + operation + \".\" + component + \".sql\";\n    }\n    \n    protected abstract String getResourcesRootDirectory();\n    \n    public void executeMandatorySchemaResource(String operation, String component) {\n        String databaseType = getDatabaseConfiguration().getDatabaseType();\n        executeSchemaResource(operation, component, getResourceForDbOperation(operation, operation, component, databaseType), false);\n    }\n\n    public void executeSchemaResource(String operation, String component, String resourceName, boolean isOptional) {\n        InputStream inputStream = null;\n        try {\n            inputStream = ReflectUtil.getResourceAsStream(resourceName);\n            if (inputStream == null) {\n                if (!isOptional) {\n                    throw new FlowableException(\"resource '\" + resourceName + \"' is not available\");\n                }\n            } else {\n                executeSchemaResource(operation, component, resourceName, inputStream);\n            }\n\n        } finally {\n            IoUtil.closeSilently(inputStream);\n        }\n    }\n\n    protected void executeSchemaResource(String operation, String component, String resourceName, InputStream inputStream) {\n        logger.info(\"performing {} on {} with resource {}\", operation, component, resourceName);\n        String sqlStatement = null;\n        String exceptionSqlStatement = null;\n        try {\n            SchemaManagerDatabaseConfiguration databaseConfiguration = getDatabaseConfiguration();\n            Connection connection = databaseConfiguration.getConnection();\n            Exception exception = null;","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/AbstractSqlScriptBasedDbSchemaManager.java#L212-L248","documentation":"executeSchemaResource loads a schema SQL script from the classpath via ReflectUtil. If the resource stream is null and the script was not marked optional, it throws FlowableException stating the resource is not available. This guards against silently 'upgrading' a database while executing nothing.","triggerScenarios":"dbSchemaUpgrade/dbSchemaCreate attempting to execute a versioned SQL script (e.g. org/flowable/db/upgrade/xxx_engine_6.5.0_to_6.6.0.sql) that is absent from the classpath, or executeMandatorySchemaResource for a mandatory script that cannot be found.","commonSituations":"Mixed Flowable jar versions on the classpath (old flowable-engine without the new upgrade scripts); custom packaging (shaded/ fat jars) that excluded SQL resources; upgrading across versions where an intermediate script does not exist; wrong database type mapping leading to a script path that was never shipped.","solutions":["Ensure all Flowable jars are the same version so every required upgrade script exists on the classpath.","Check that the build/packaging does not exclude .sql resources from the jars.","Upgrade through supported version steps that include the missing script, or run the missing SQL manually and update the schema version property.","Inspect the resourceName in the message and confirm the file exists in the flowable-engine jar."],"exampleFix":"// before (pom.xml, mixed versions)\n<dependency><groupId>org.flowable</groupId><artifactId>flowable-engine</artifactId><version>6.6.0</version></dependency>\n<dependency><groupId>org.flowable</groupId><artifactId>flowable-engine-common</artifactId><version>6.4.2</version></dependency>\n// after\n<dependency><groupId>org.flowable</groupId><artifactId>flowable-engine</artifactId><version>6.6.0</version></dependency>\n<dependency><groupId>org.flowable</groupId><artifactId>flowable-engine-common</artifactId><version>6.6.0</version></dependency>","handlingStrategy":"validation","validationCode":"String res = \"org/flowable/db/upgrade/flowable_mysql_engine_6.5.0_to_6.6.0.sql\";\nif (getClass().getClassLoader().getResource(res) == null) throw new IllegalStateException(\"Missing schema script: \" + res);","typeGuard":null,"tryCatchPattern":"try { engineCfg.buildProcessEngine(); } catch (FlowableException e) { if (e.getMessage().startsWith(\"resource '\")) { log.error(\"Missing schema script — check jar versions/classpath: {}\", e.getMessage()); } throw e; }","preventionTips":["Keep all org.flowable artifacts at exactly the same version","Verify fat/shaded jars include org/flowable/db/**/*.sql resources","Upgrade through supported intermediate versions that ship every needed script","Unzip the flowable-engine jar and confirm the script named in the error exists"],"tags":["classpath","resource-not-found","schema-upgrade","database"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}