More than one fragment with the name [spring_web] was found / Cannot find the declaration of element 'beans' / server without internet access

后端 未结 1 1902
猫巷女王i
猫巷女王i 2021-01-24 07:53

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

相关标签:
1条回答
  • 2021-01-24 08:07

    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.

    Dave

    0 讨论(0)
提交回复
热议问题