관리 메뉴

Just Do it

[스프링/STS] More than one fragment with the name [spring_web] was found 본문

신입 개발자가 되기 위해 공부했던 독학 자료들/에러 해결 모음

[스프링/STS] More than one fragment with the name [spring_web] was found

Seojoo21 2022. 3. 25. 09:38

1. 에러 

아침에 STS를 열고 서버를 실행하는데 만난 에러. 어제까지만 해도 이상 없이 돌아가던 프로젝트였는데 갑자기 이러는 것이 이해가 되지 않았다. 

 

이름이 [spring-web]인, 둘 이상의 fragment들이 발견되었습니다. 이는 상대적 순서배열에서 불허됩니다. 상세 정보는 서블릿 스펙 8.2.2 2c 장을 참조하십시오. 절대적 순서배열을 사용하는 것을 고려해보십시오. 

 

Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [spring_web] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering.

 

2. 원인 

 

3. 해결

web.xml에 아래와 같이 <absolue-ordering/> 코드 한 줄을 추가해줬다.  

위와 같이 해도 해결이 되지 않는다면 [프로젝트 우클릭> Run As> Maven Clean]후 다시 [Run As> Maven Install]하면 된다고 하는데 나는 다행히 저 코드 한 줄로 해결되었다.

 

출처:

https://stackoverflow.com/questions/54290263/more-than-one-fragment-with-the-name-spring-web-was-found-this-is-not-legal-w

https://jmlim.tistory.com/5