MVN package spring works into jar times unable to locate Spring Namespacehandler for XML schema namespace error resolution

Source: Internet
Author: User
There is a small project that uses spring, after using MAVEN's assembly package into a standalone executable jar package, the following error is executed in the Times:
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>  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.