Best practices for validating the configuration of a Spring web application <p>I would like that my Spring-based web application were able to <em>validate</em> its configuration during startup.</p> <p>This means for example:</p> <ul> <li>check if the <strong>required folders</strong> exist and are readable/writable</li> <li>check if the required <strong>configuration keys</strong> are set and consistent</li> <li>...</li> <li>check any other <strong>constraint</strong> that is required for the correct functioning</li> </ul> <p>How can you perform these checks and <strong>notify</strong> the system administrator if something is wrong?</p> <p>The goal is to reduce the risk that some critical error arises when the application is actually going to need those resources that are bound to the wrong configuration.</p> <p><strong>NOTE:</strong> my approach is to use a special <strong>EnvironmentValidation</strong> bean that checks if the configuration/folder structure is ok and if not it throws an exception</p>