project Development using Dubbo, want to make the service executable jar package, and all the dependencies are packaged into this jar file, the project relies on the use of spring, etc., after the use of MAVEN assembly packaged into a standalone executable jar package, in the execution times the following error:
Configuration problem:unable to locate Spring Namespacehandler for XML schema namespace
This issue is also mentioned on the Internet, which is a bug in assembly. See: Http://jira.codehaus.org/browse/MASSEMBLY-360 The reason is that many of the jar packages in spring contain spring.handlers and Spring.schemas files, and assembly will only break the first encountered file into the jar package, which will be missed later.
the solution is to give up assembly, Use the shade plug-in to package. Specifies that spring.handlers and spring.schemas files are added append in the shade packaging configuration to ensure that the information of the two files in other spring jars is not omitted. Here is an example of a configuration:
<plugin><groupId>org.apache.maven.plugins</groupId>< artifactid>maven-shade-plugin</artifactid><version>1.4</version><executions>< execution><phase>package</phase><goals><goal>shade</goal></goals>< Configuration><transformers><transformerimplementation= " Org.apache.maven.plugins.shade.resource.ManifestResourceTransformer "><mainClass> Activiti.server.deploy.server</mainclass></transformer><transformerimplementation= " Org.apache.maven.plugins.shade.resource.AppendingTransformer "><resource>meta-inf/spring.handlers</ Resource></transformer><transformerimplementation= " Org.apache.maven.plugins.shade.resource.AppendingTransformer "><resource>meta-inf/spring.schemas</ Resource></transformer></transformers></configuration></execution></executions ></plugin>
Right-click the project and run MVN install to package successfully.
The workaround for starting the Times wrong spring error with the standalone executable jar package assembly