DavesPlanet
DavesPlanet

Reputation: 680

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

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."

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.

Upvotes: 1

Views: 10296

Answers (1)

DavesPlanet
DavesPlanet

Reputation: 680

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

Upvotes: 1

Related Questions