找到了多个名称为[spring_web]的片段/无法访问元素'beans'的声明/服务器无法访问互联网 [英] More than one fragment with the name [spring_web] was found / Cannot find the declaration of element 'beans' / server without internet access

查看:576
本文介绍了找到了多个名称为[spring_web]的片段/无法访问元素'beans'的声明/服务器无法访问互联网的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一场春季大战,不会部署在未​​连接到Internet的任何服务器上.错误是 发现了多个名称为[spring_web]的片段" 来自问题54290263的一个受到高度评价和成功的建议是

We had a spring war that would not deploy on any server that was not connected to the internet. The error was "More than one fragment with the name [spring_web] was found" One highly upvoted and successful suggestion from question 54290263 was

"add <absolute-ordering /> tag to your web.xml just under the <display-name> tag."

这将错误更改为 找不到元素'beans'的声明" 但仍然不允许服务器启动.

This changed the error to "Cannot find the declaration of element 'beans'" but still did not allow the server to start.

请注意,服务器可以在任何可以上网的计算机上正常运行.

Note that the server started fine on any machine that could hit the internet.

推荐答案

关于第一个错误的大多数建议都表明我们有冲突的春豆.我在没有找到任何答案的情况下浏览了lib文件夹和依赖项树.然后,我发现我们的上下文文件spring xsd定义都列出了spring项目的特定版本,这些版本彼此之间以及与pom文件发生冲突.这是旧样式,应替换为"spring-whatevertool.xsd".现在具体应该看起来像这样:

Most suggestions for the first error suggested we had clashing spring beans. I poured through lib folders and dependency trees without finding any answer. I then found that our context file spring xsd definitions all listed specific versions of spring projects which clashed with each other and with the pom files. This is old style and should be replaced with "spring-whatevertool.xsd". Specifically should look like this now:

http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/util/spring-util.xsd

仅靠这一点并不能解决问题,而是与绝对排序"的原始建议结合使用.那是成功的.这也导致可部署程序的启动过程更加清洁和快速.

This alone did not fix the problem, but when combined with the original suggestion of "absolute-ordering" was successful. It also resulted in a much cleaner and faster startup of the deployable.

戴夫

这篇关于找到了多个名称为[spring_web]的片段/无法访问元素'beans'的声明/服务器无法访问互联网的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆