Spring 3 NamespaceHandler issues with Maven Shade plugin

Spring 3.1.1.RELEASE with Apache Maven 3.0.3 and Maven Shade plugin 1.6.

Using the mvn shade plugin to package the artifact in an uber-jar, including its dependencies:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>1.6</version>
    <executions>
        <execution>
        <phase>package</phase>
        <goals>
            <goal>shade</goal>
        </goals>
        <configuration>
            <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                    <mainClass>com.MyApplication</mainClass>
                </transformer>
            </transformers>
        </configuration>
    </execution>
</executions>

Seems to package just fine but on execution complains of Spring NamespaceHandler issues:

Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/util]
Offending resource: class path resource [spring/test-context.xml]

This applies to both the util and p-namespaces, but expect it's not limited to these:

xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"

If I rewrite the property or list (util) longhand the issues disappear.

Answers


Try adding an AppendingTransformer to your config. The example specifically mentions this as being useful for Spring handlers.


Need Your Help

How can I install the Beautiful Soup module on the Mac?

python macos module installation

I read this without finding the solution: http://docs.python.org/install/index.html

twitter search api with jquery error

jquery ajax twitter jsonp

I need to request a twitter search with jquery using twitter api. After read documentation I write this code: