Spring 3.0: Unable to locate Spring NamespaceHandler for XML schema namespace Spring 3.0: Unable to locate Spring NamespaceHandler for XML schema namespace java java

Spring 3.0: Unable to locate Spring NamespaceHandler for XML schema namespace


Encountered this error while using maven-shade-plugin, the solution was including:

META-INF/spring.schemas

and

META-INF/spring.handlers

transformers in the maven-shade-plugin when building...

    <plugin>        <groupId>org.apache.maven.plugins</groupId>        <artifactId>maven-shade-plugin</artifactId>        <executions>            <execution>                <phase>package</phase>                <goals>                    <goal>shade</goal>                </goals>                <configuration>                    <transformers>                        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">                            <resource>META-INF/spring.handlers</resource>                        </transformer>                        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">                            <resource>META-INF/spring.schemas</resource>                        </transformer>                    </transformers>                </configuration>            </execution>        </executions>    </plugin>

(Credits: Idea to avoid that spring.handlers/spring.schemas get overwritten when merging multiple spring dependencies in a single jar)


http://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html

I ran into a similar problem using the maven-shade-plugin. I found the solution to my problems in their example page above.


What IDE (if any) are you using? Does this happen when you're working within an IDE, or only on deployment? If it's deployment, it might be because whatever mechanism of deployment you use -- maven-assembly making a single JAR with dependencies is a known culprit -- is collapsing all your JARs into a single directory and the Spring schema and handler files are overwriting each other.