前提・実現したいこと
http://localhost:8080/ にアクセスして
spring bootでhello word と表示させたい
発生している問題・エラーメッセージ
2021-04-17 17:02:34.597[0;39m [32m INFO[0;39m [35m13325[0;39m [2m---[0;39m [2m[nio-8080-exec-1][0;39m [36mo.apache.coyote.http11.Http11Processor [0;39m [2m:[0;39m Error parsing HTTP request header Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Request header is too large at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:779) ~[tomcat-embed-core-9.0.45.jar:9.0.45] at org.apache.coyote.http11.Http11InputBuffer.parseHeader(Http11InputBuffer.java:946) ~[tomcat-embed-core-9.0.45.jar:9.0.45] at org.apache.coyote.http11.Http11InputBuffer.parseHeaders(Http11InputBuffer.java:593) ~[tomcat-embed-core-9.0.45.jar:9.0.45] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:284) ~[tomcat-embed-core-9.0.45.jar:9.0.45] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.45.jar:9.0.45] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) ~[tomcat-embed-core-9.0.45.jar:9.0.45] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707) ~[tomcat-embed-core-9.0.45.jar:9.0.45] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.45.jar:9.0.45] 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.45.jar:9.0.45] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Type Exception Report Message Request header is too large Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). Exception java.lang.IllegalArgumentException: Request header is too large org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:779) org.apache.coyote.http11.Http11InputBuffer.parseHeader(Http11InputBuffer.java:946) org.apache.coyote.http11.Http11InputBuffer.parseHeaders(Http11InputBuffer.java:593) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:284) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.base/java.lang.Thread.run(Thread.java:834) Note The full stack trace of the root cause is available in the server logs.
該当のソースコード
package com.example.demo; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @Controller public class HelloWorld { @GetMapping("/") // ② public String hello() { return "hello"; // ③ } }
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>baseball</title> </head> <body> <h1>HelloWorld</h1> </body> </html>
package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class MyappApplication { public static void main(String[] args) { SpringApplication.run(MyappApplication.class, args); } }
試したこと
ここに問題に対して試したことを記載してください。
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/04/17 10:05