加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

关于 Unable to locate xxx NamespaceHandler for XML schema na

发布时间:2020-12-16 02:09:09 所属栏目:百科 来源:网络整理
导读:遇见的 UnabletolocatexxxNamespaceHandlerforXMLschemanamespace 相关问题以后,目前总结主要有两种情况: 1. 非spring的xml Schema报错 这时候根据遇见的两次错误,基本上可以定位为缺少pom的依赖。因为有相应的jar包依赖,就会自动下载相关的xsd文件并且

遇见的 UnabletolocatexxxNamespaceHandlerforXMLschemanamespace 相关问题以后,目前总结主要有两种情况:

1. 非spring的xml Schema报错

这时候根据遇见的两次错误,基本上可以定位为缺少pom的依赖。因为有相应的jar包依赖,就会自动下载相关的xsd文件并且打包到jar文件中。

2. 遇见 spring的xml Schema报错

如果已经配置了spring的相关pom依赖,则基本上是由于在进行打包配置时的maven插件问题造成的。放弃assembly的打包方式,而换用shade方式,在pom中的配置如下:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.3</version>
                <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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读