{"record":{"id":"70d9cbb98e715f6d","repo":"OpenAPITools/openapi-generator","slug":"failed-to-canonicalize-file-testdatafilestr","errorCode":null,"errorMessage":"Failed to canonicalize file {testDataFileStr}","messagePattern":"Failed to canonicalize file (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java","lineNumber":1338,"sourceCode":"        if (generateOperationBody) {\n\n            boolean loadTestDataFromFile = convertPropertyToBooleanAndWriteBack(LOAD_TEST_DATA_FROM_FILE);\n            this.setLoadTestDataFromFile(loadTestDataFromFile);\n\n            if (loadTestDataFromFile) {\n                String testDataFileStr;\n                if (additionalProperties.containsKey(TEST_DATA_FILE))\n                    testDataFileStr = (String) additionalProperties.get(TEST_DATA_FILE);\n                else\n                    testDataFileStr = outputFolder() + \"/src/main/resources/test-data.json\";\n                testDataFileStr = testDataFileStr.replace('/', File.separatorChar);\n                try {\n                    File testDataFile = new File(testDataFileStr).getCanonicalFile();\n                    testDataFileStr = testDataFile.getPath();\n                    additionalProperties.put(TEST_DATA_FILE, testDataFileStr.replaceAll(\"\\\\\\\\\", \"\\\\\\\\\\\\\\\\\"));\n                    setTestDataFile(testDataFile);\n                } catch (IOException e) {\n                    throw new RuntimeException(\"Failed to canonicalize file \" + testDataFileStr, e);\n                }\n\n                testDataCache = JsonCache.Factory.instance.get(\"test-data\").mergePolicy(MergePolicy.KEEP_EXISTING)\n                        .child('/' + invokerPackage);\n                if (this.testDataFile.exists()) {\n                    try {\n                        testDataCache.root().load(this.testDataFile);\n                    } catch (CacheException e) {\n                        LOGGER.error(\"Unable to load test data file \" + testDataFileStr, e);\n                    }\n                }\n\n                String testDataControlFileStr;\n                if (additionalProperties.containsKey(TEST_DATA_CONTROL_FILE))\n                    testDataControlFileStr = (String) additionalProperties.get(TEST_DATA_CONTROL_FILE);\n                else\n                    testDataControlFileStr = outputFolder() + \"/test-data-control.json\";\n                testDataControlFileStr = testDataControlFileStr.replace('/', File.separatorChar);","sourceCodeStart":1320,"sourceCodeEnd":1356,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java#L1320-L1356","documentation":"Error \"Failed to canonicalize file {testDataFileStr}\" thrown in OpenAPITools/openapi-generator.","triggerScenarios":"Thrown when the Java CXF-ext server generator cannot canonicalize the configured test data file path (invalid path or I/O error). Verify the testDataFile option points to an existing, readable file.","commonSituations":"See trigger scenarios.","solutions":["Check that the test data file path exists and is readable; verify the configured testDataFile location."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}