해결된 질문
작성
·
8.4K
3
안녕하세요 v5 추가하고 나니 갑자기 이전 작업들도 안되고 다음 오류가 떠서 질문 남깁니다ㅠㅠ
서블릿, JSP, 서블릿 MVC 중에서 서블릿만 작동되고 JSP는 누르면 파일이 다운로드 되네요
나머지는 Whitelabel Error Page와 404가 뜹니다
뭘 잘못 건드린건지 감도 안잡혀요
검색해보니 인코딩 문제일수도 있다는데 저는 크롬을 사용해서 자동으로 인코딩 될텐데.. 문제를 모르겠어요 ㅠㅠ
제 코드는 아래와 같습니다
https://github.com/yeon-06/inflearnMvc1
오류나는 구간은 branch 따로 분리해두었습니다
오류 코드는 아래와 같습니다
2021-05-20 16:35:32.017 WARN 8656 --- [nio-8080-exec-2] o.s.w.s.r.ResourceHttpRequestHandler : Path with "WEB-INF" or "META-INF": [WEB-INF/views/new-form.jsp]
2021-05-20 16:35:32.045 DEBUG 8656 --- [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: [776]
2021-05-20 16:35:32.045 DEBUG 8656 --- [nio-8080-exec-2] o.a.coyote.http11.Http11InputBuffer : Received []
2021-05-20 16:35:32.045 DEBUG 8656 --- [nio-8080-exec-2] o.apache.coyote.http11.Http11Processor : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@5b8d04a4:org.apache.tomcat.util.net.NioChannel@7ca16f33:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:65531]], Status in: [OPEN_READ], State out: [OPEN]
2021-05-20 16:35:34.899 DEBUG 8656 --- [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: [776]
2021-05-20 16:35:34.909 DEBUG 8656 --- [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:1345) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1255) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:794) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:359) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:261) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
2021-05-20 16:35:34.911 DEBUG 8656 --- [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:1345) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1255) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:794) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:359) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:261) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.44.jar:9.0.44]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
답변 3
12
안녕하세요! 해결했는데 저와 같은 고민이 생기시는 분이 생기실까봐 해결 방법 올립니다~!
김영한님 소스 코드랑 비교했는데도 잘못된 부분이 없어서 정말.. 오랜 시간 이거만 들여다보고 있었는데요....
결론은 build.gradle을 refresh 해서 해결했습니다
회사와 집을 왔다갔다 하며 듣느라 작업 환경이 많이 바뀌었었는데...
build.gradle안의 jsp를 인식해주는 다음 부분이 제대로 주입이 안되어서 발생했던 문제인 것 같습니다ㅠㅠ
implementation 'org.apache.tomcat.embed:tomcat-embed-jasper'
implementation 'javax.servlet:jstl'
0
0
안녕하세요. ᄇᄅᄃ님
다음 링크에 보시면 예제 프로젝트가 제공됩니다.
https://www.inflearn.com/course/%EC%8A%A4%ED%94%84%EB%A7%81-mvc-1/lecture/71807?tab=curriculum
예제 프로젝트를 받아서 실행해보시고, 만약 문제가 없다면 예제 프로젝트와 비교해보면 금방 문제를 찾을수 있을거에요.
감사합니다.
공유 감사합니다^^