A strange error is thrown when I turn on configuration file validation, how can I fix this? - Mach-II/Mach-II-Framework GitHub Wiki

When I turn on the new configuration file validation feature in Mach-II, ColdFusion MX7+ throws an error similar to this one:

    Error validating XML file:
    C:\wwwroot\myApp\config\mach-ii.xml:
    Line 12, Column 24: cvc-elt.1 - Cannot find the declaration of element 'mach-ii'.

The problem lies in Xerces2-J XML parser from Apache which CFMX7 uses to validate the configuration file against the DTD.

You can correct the error by explicitly adding a doctype declaration to configuration file (you may have to change paths):

    <!DOCTYPE mach-ii SYSTEM
        "http://localhost:8500/MachII/mach-ii_1_5_0.dtd">

or

    <!DOCTYPE mach-ii PUBLIC
        "-//Mach-II//DTD Mach-II Configuration 1.5.0//EN"
        "http://www.mach-ii.com/dtds/mach-ii_1_5_0.dtd">

It appears that as long as you specify a doctype declaration, even if the url to the DTD is not even valid, ColdFusion will validate the configuration file against the default DTD that is specified in your index.cfm or Application.cfc file.

Back to FAQs