OpenAPITools/openapi-generator · error · RuntimeException

Failed to canonicalize file {testDataControlFileStr}

Error message

Failed to canonicalize file {testDataControlFileStr}

What it means

Error "Failed to canonicalize file {testDataControlFileStr}" thrown in OpenAPITools/openapi-generator.

Source

Thrown at modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java:1364

                    } catch (CacheException e) {
                        LOGGER.error("Unable to load test data file " + testDataFileStr, e);
                    }
                }

                String testDataControlFileStr;
                if (additionalProperties.containsKey(TEST_DATA_CONTROL_FILE))
                    testDataControlFileStr = (String) additionalProperties.get(TEST_DATA_CONTROL_FILE);
                else
                    testDataControlFileStr = outputFolder() + "/test-data-control.json";
                testDataControlFileStr = testDataControlFileStr.replace('/', File.separatorChar);
                try {
                    File testDataControlFile = new File(testDataControlFileStr).getCanonicalFile();
                    testDataControlFileStr = testDataControlFile.getPath();
                    additionalProperties.put(TEST_DATA_CONTROL_FILE,
                            testDataControlFileStr.replaceAll("\\\\", "\\\\\\\\"));
                    setTestDataControlFile(testDataControlFile);
                } catch (IOException e) {
                    throw new RuntimeException("Failed to canonicalize file " + testDataControlFileStr, e);
                }

                testDataControlCache = JsonCache.Factory.instance.get("test-data-control")
                        .mergePolicy(MergePolicy.KEEP_EXISTING).child('/' + invokerPackage);
                if (this.testDataControlFile.exists()) {
                    try {
                        testDataControlCache.root().load(this.testDataControlFile);
                    } catch (CacheException e) {
                        LOGGER.error("Unable to load test data control file " + testDataControlFileStr, e);
                    }
                }
            }
        }
        if (this.generateSpringApplication) {
            if (supportMultipleSpringServices) {
                SupportingFile supportingFile = null;
                for (SupportingFile sf : supportingFiles) {
                    if ("server/ApplicationContext.xml.mustache".equals(sf.getTemplateFile())) {

View on GitHub (pinned to fcec517be3)

Solutions

  1. Check that the test data control file path exists and is readable; verify the configured testDataControlFile location.

When it happens

Trigger: Thrown when the Java CXF-ext server generator cannot canonicalize the configured test data control file path (invalid path or I/O error). Verify the testDataControlFile option points to an existing, readable file.

Common situations: See trigger scenarios.


AI-assisted analysis of OpenAPITools/openapi-generator@fcec517be3 (2026-08-22). Data as JSON: /api/errors/53298719e78fa4f7. Report an issue: GitHub.