Spring: How to solve the error “Failed to read schema document”

I have worked on migrating an Ant project to Maven that has a couple of XML Spring configuration files.

When deploying I got the error Failed to read schema document 'http://www.springframework.org/schema/security/spring-security-3.1.xsd’ because Spring was not able to find the XSD file when parsing one of my XML files.

Here is the solution: you are missing a dependency that contains the XSD file.

Spring puts XSD files in folder META-INF/spring.schemas, you just have to find the dependency that contains this file, and quickly check if the XSD you miss is mentioned.

In my case the XSD file for spring-security-3.1 is located into artifact “spring-security-config”.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.