강의

멘토링

커뮤니티

인프런 커뮤니티 질문&답변

이상현님의 프로필 이미지
이상현

작성한 질문수

스프링 부트 개념과 활용

내장 웹 서버 이해

스프링 부트 2.1.1 버전에서는 Tomcat에서 8080 포트가 열리지 않습니다.

해결된 질문

작성

·

1.4K

1

- 스프링 부트 2.1.1 버전에서는 톰캣 9.0 버전이 사용되고

Jun 02, 2019 11:33:48 PM org.apache.catalina.core.StandardContext setPath
경고: A context path must either be an empty string or start with a '/' and do not end with a '/'. The path [/] does not meet these criteria and has been changed to []
Jun 02, 2019 11:33:48 PM org.apache.catalina.core.StandardService startInternal
정보: Starting service [Tomcat]
Jun 02, 2019 11:33:48 PM org.apache.catalina.core.StandardEngine startInternal
정보: Starting Servlet Engine: Apache Tomcat/9.0.13

다음과 같이 나오고 실제로 8080이 연결 되지 않습니다.

- 스프링 부트 2.0.3 버전으로 하면 톰캣 8.5 버전이 실행되고 8080 접속이 제대로 됩니다.

Jun 02, 2019 11:38:41 PM org.apache.catalina.core.StandardContext setPath
경고: A context path must either be an empty string or start with a '/' and do not end with a '/'. The path [/] does not meet these criteria and has been changed to []
Jun 02, 2019 11:38:42 PM org.apache.coyote.AbstractProtocol init
정보: Initializing ProtocolHandler ["http-nio-8080"]
Jun 02, 2019 11:38:42 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
정보: Using a shared selector for servlet write/read
Jun 02, 2019 11:38:42 PM org.apache.catalina.core.StandardService startInternal
정보: Starting service [Tomcat]
Jun 02, 2019 11:38:42 PM org.apache.catalina.core.StandardEngine startInternal
정보: Starting Servlet Engine: Apache Tomcat/8.5.31
Jun 02, 2019 11:38:42 PM org.apache.coyote.AbstractProtocol start
정보: Starting ProtocolHandler ["http-nio-8080"]

 

실제로 netstat 에서 8080이 사용되지 않네요.

 

감사합니다.

답변 1

3

백기선님의 프로필 이미지
백기선
지식공유자

스프링 부트가 기본으로 사용하는 톰캣 버전이 올라가서 그런지..

A context path must either be an empty string or start with a '/' and do not end with a '/'. The path [/] does not meet these criteria and has been changed to []

이 메시지를 잘읽어보시면, 컨텍스트 패스를 빈 문자열로 하거나, "/"로 시작은 하지만 "/"로 끝나지 않는 경로로 설정하라고 하네요.
그것만 지켜주신다면 스프링 부트 최신 버전에서도 내장 톰캣을 띄우는데 문제는 없을텐데요. 실제로 저런식으로 톰캣을 직접 띄울 일은 거의 없으니.. 아 저렇게도 할 수 있나보다.. 정도로 보고 넘어가셔도 괜찮습니다.

이상현님의 프로필 이미지
이상현

작성한 질문수

질문하기