Thursday, 6 November 2014

Maven spring namespace not found



I've trawled through a number of similar questions, but no one seems to have an answer for this problem, so I'm hoping someone will have a new solution to this issue:


I'm wrestling with this error:



2014-11-06 12:21:57 DEBUG PluggableSchemaResolver:147 - Loaded schema mappings: {}
2014-11-06 12:21:58 DEBUG DefaultBeanDefinitionDocumentReader:108 - Loading bean definitions
2014-11-06 12:21:58 DEBUG DefaultNamespaceHandlerResolver:157 - Loaded NamespaceHandler mappings: {}

Caused by: java.lang.RuntimeException: Exception in Application start method
....
Caused by: java.lang.RuntimeException: Exception in Application start method
....
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://ift.tt/GArMu7]
Offending resource: class path resource [clientSpringConfig.xml]


Here is a chunk of my program's client-side POM.



<execution>
<id>myClient</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<outputFile>C:\Dev\MyAppDeploy\Client\MyAppClient.jar</outputFile>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>uk.co.mycom.myClient.ClientStart</Main-Class>
<Class-Path>.</Class-Path>
</manifestEntries>
</transformer>
<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>
<filters>
<filter>
<artifact>*:*</artifact>
<includes>
<include>uk/co/mycom/myClient/**</include>
<include>uk/co/mycom/shared/**</include>
<include>com/esotericsoftware/**</include>
<include>org/springframework/**</include>
<include>org/apache/log4j/**</include>
<include>log4j.properties</include>
<include>org/apache/commons/logging/**</include>
<include>org/objenesis/**</include>
</includes>
<excludes>
<exclude>uk/co/mycom/myAppServer/**</exclude>
<!--<exclude>resources/**</exclude>-->
<exclude>bat/**</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>


I like Maven shade and feel loathe to move, but I need to use Spring client side, and so what worked before now no longer works. I've seem folk advise Maven Assembly plugin. But as far as I can work out, the result is the same: if two files match, one will overwrite the other.


Any help much appreciated. Thanks.


No comments:

Post a Comment