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

최성현님의 프로필 이미지
최성현

작성한 질문수

스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술

Hello 서블릿

EOFException

작성

·

1.5K

0

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.

1. 강의 내용과 관련된 질문을 남겨주세요.
2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.
(자주 하는 질문 링크: https://bit.ly/3fX6ygx)
3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.
(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)

질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.
=========================================
[질문 템플릿]
1. 강의 내용과 관련된 질문인가요? (예/아니오) 예
2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 아니오. (있지만 해결x)
3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) 예

[질문 내용]

강의와 같이 logging.level.org.apache.coyote.http11=debug 를 적용하고 나면 헤더 정보는 잘 나오지만 헤더 정보 아래에 EOF 오류 내용이 같이 나옵니다.
다른 질문에서 답변하신 내용(다른글 해결법)을 따라해봐도 똑같습니다.

application.proterties에서 경고가 뜨는데 이거와 관련된 사항인지는 모르겠습니다. application_properties.PNG아래 사진은 로그에서 뜬 에러부분입니다.

에러.PNG

[전체 로그]

오후 4:46:17: Executing ':ServletApplication.main()'...

> Task :compileJava UP-TO-DATE

> Task :processResources UP-TO-DATE

> Task :classes UP-TO-DATE

> Task :ServletApplication.main()

. ____ _

/\\ / ___'_ __ (_)_ _ \ \ \ \

( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \

\\/ ___)| |_)| | | | | || (_| | ) ) ) )

' |____| .__|_| |_|_| |_\__, | / / / /

=========|_|==============|___/=/_/_/_/

:: Spring Boot :: (v2.7.11)

2023-04-29 16:46:19.611 INFO 13608 --- [ main] hello.servlet.ServletApplication : Starting ServletApplication using Java 11.0.19 on 960691 with PID 13608 (C:\Users\CKIRUser\IdeaProjects\Spring_MVC_part1\build\classes\java\main started by CKIRUser in C:\Users\CKIRUser\IdeaProjects\Spring_MVC_part1)

2023-04-29 16:46:19.615 INFO 13608 --- [ main] hello.servlet.ServletApplication : No active profile set, falling back to 1 default profile: "default"

2023-04-29 16:46:21.028 INFO 13608 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)

2023-04-29 16:46:21.049 INFO 13608 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]

2023-04-29 16:46:21.049 INFO 13608 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.74]

2023-04-29 16:46:21.243 INFO 13608 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext

2023-04-29 16:46:21.244 INFO 13608 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1511 ms

2023-04-29 16:46:21.602 INFO 13608 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: ServletContext resource [/index.html]

2023-04-29 16:46:21.919 INFO 13608 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''

2023-04-29 16:46:21.932 INFO 13608 --- [ main] hello.servlet.ServletApplication : Started ServletApplication in 3.094 seconds (JVM running for 3.585)

2023-04-29 16:46:26.629 DEBUG 13608 --- [nio-8080-exec-1] o.a.coyote.http11.Http11InputBuffer : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [0]

2023-04-29 16:46:26.630 DEBUG 13608 --- [nio-8080-exec-1] o.a.coyote.http11.Http11InputBuffer : Received [GET /basic.html HTTP/1.1

Host: localhost:8080

Connection: keep-alive

Cache-Control: max-age=0

sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="98", "Microsoft Edge";v="98"

sec-ch-ua-mobile: ?0

sec-ch-ua-platform: "Windows"

Upgrade-Insecure-Requests: 1

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.56

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9

Sec-Fetch-Site: same-origin

Sec-Fetch-Mode: navigate

Sec-Fetch-User: ?1

Sec-Fetch-Dest: document

Referer: http://localhost:8080/

Accept-Encoding: gzip, deflate, br

Accept-Language: ko,en;q=0.9,en-US;q=0.8

If-Modified-Since: Sat, 29 Apr 2023 07:31:04 GMT

]

2023-04-29 16:46:26.672 INFO 13608 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'

2023-04-29 16:46:26.672 INFO 13608 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'

2023-04-29 16:46:26.674 INFO 13608 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 2 ms

2023-04-29 16:46:26.720 DEBUG 13608 --- [nio-8080-exec-1] o.a.coyote.http11.Http11InputBuffer : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [803]

2023-04-29 16:46:26.721 DEBUG 13608 --- [nio-8080-exec-1] o.a.coyote.http11.Http11InputBuffer : Received []

2023-04-29 16:46:26.723 DEBUG 13608 --- [nio-8080-exec-1] o.apache.coyote.http11.Http11Processor : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@5fab773e:org.apache.tomcat.util.net.NioChannel@643c15bf:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:60731]], Status in: [OPEN_READ], State out: [OPEN]

2023-04-29 16:46:31.060 DEBUG 13608 --- [nio-8080-exec-2] o.a.coyote.http11.Http11InputBuffer : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [803]

2023-04-29 16:46:31.062 DEBUG 13608 --- [nio-8080-exec-3] o.a.coyote.http11.Http11InputBuffer : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [0]

2023-04-29 16:46:31.069 DEBUG 13608 --- [nio-8080-exec-3] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header

java.io.EOFException: null

at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1347) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1234) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:785) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:348) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:262) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]

2023-04-29 16:46:31.070 DEBUG 13608 --- [nio-8080-exec-2] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header

java.io.EOFException: null

at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1347) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1234) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:785) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:348) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:262) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]

2023-04-29 16:46:31.071 DEBUG 13608 --- [nio-8080-exec-3] o.apache.coyote.http11.Http11Processor : Error state [CLOSE_CONNECTION_NOW] reported while processing request

java.io.EOFException: null

at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1347) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1234) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:785) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:348) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:262) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]

2023-04-29 16:46:31.071 DEBUG 13608 --- [nio-8080-exec-3] o.apache.coyote.http11.Http11Processor : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@5fab773e:org.apache.tomcat.util.net.NioChannel@643c15bf:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:60731]], Status in: [OPEN_READ], State out: [CLOSED]

2023-04-29 16:46:31.071 DEBUG 13608 --- [nio-8080-exec-2] o.apache.coyote.http11.Http11Processor : Error state [CLOSE_CONNECTION_NOW] reported while processing request

java.io.EOFException: null

at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1347) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1234) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:785) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:348) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:262) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.74.jar:9.0.74]

at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]

2023-04-29 16:46:31.072 DEBUG 13608 --- [nio-8080-exec-2] o.apache.coyote.http11.Http11Processor : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@63a885d8:org.apache.tomcat.util.net.NioChannel@2b29aa4:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:60730]], Status in: [OPEN_READ], State out: [CLOSED]

 

답변 2

0

안녕하세요. 최성현님, 공식 서포터즈 OMG입니다.
.

답변이 늦었습니다. 현재 어느 부분까지 진행중이실까요?

jsp부분까지 진행중이시라면 아래 링크를 참고해보시고,

https://www.inflearn.com/questions/216827/error-parsing-http-request-header-%EC%97%90%EB%9F%AC

해당 설정을 지웠을 때 오류가 출력되지 않는다면 제거하고 진행하여도 무방할 것 같습니다.

logging.level.org.apache.coyote.http11=debug

해결방법을 알고 계신분은 공유 부탁드립니다 :)

.
감사합니다.

0

안녕하세요. 최성현님, 공식 서포터즈 David입니다.

설정 자체는 문제 없어 보입니다.

아래 가이드대로 프로젝트를 공유해 주시고, 어떻게 실행하셨는지 구체적으로 작성해 주시면 오류 확인해 보겠습니다.


전체 프로젝트를 압축한 뒤
구글 드라이브로 공유해서 링크를 남겨주세요.

1. 구글 드라이브 업로드 방법

구글 드라이브 업로드 방법
링크

2. 주의사항
구글 드라이브 공유시
권한을 반드시 확인해주세요

3. 아래 내용을 작성 부탁드립니다.
a. 프로젝트 실행 방법을 알려주세요.
b. 어떻게 문제를 확인할 수 있는지 자세한 설명을 남겨주세요.

감사합니다.

최성현님의 프로필 이미지
최성현
질문자

https://drive.google.com/file/d/1DAl6erIKdG0tNNr5K0x2EUSlw2U3wMVu/view?usp=sharing

실행 방법 : ServletApplication 실행

문제 확인 : 로그 (윗 글 사진)

입니다. 감사합니다!

 

최성현님의 프로필 이미지
최성현

작성한 질문수

질문하기