Solucionado (ver solução)
Solucionado
(ver solução)
9
respostas

[Dúvida] http formulou outra coisa

Oie, boa tarde! Fiz meu cógido, mas o "/filmes" não funcionou. Ele me mandou outro endereço.

Insira aqui a descrição dessa imagem para ajudar na acessibilidadeInsira aqui a descrição dessa imagem para ajudar na acessibilidadeSegue meu código JAVA:

package com.example.screenmatch.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
@RequestMapping ("/filmes")
public class FilmeController {
    @GetMapping
    public String carregaPaginaFormulario(){
    return "filmes/formulario";
    }
}

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Cadastro de filme</title>
</head>
<body>
<h1>Cadastro de filme</h1>
</body>
</html>

Obrigada desde já!

9 respostas

Oi!

O código está correto.

Essa tela de erro ao entrar no localhost:8080 geralmente aparece quando o projeto não foi inicializado corretamente no IntelliJ. Verifica se a classe main do projeto foi executada e saiu o log de inicialização do Spring Boot no console do Intellij

Rodrigo, Está aparecendo isso: Insira aqui a descrição dessa imagem para ajudar na acessibilidadeInsira aqui a descrição dessa imagem para ajudar na acessibilidade E continua com o mesmo erro.

MAnda aqui esse log completo. Em texto mesmo, pq mandando print fica cortado

Oiee, Continuei as aulas e desapareceu esse erro. O que continua é a página que não responde ao meu https://localhost:8080/filmes

**Imagem do erro: ** Insira aqui a descrição dessa imagem para ajudar na acessibilidadeAparece isso no print:

. ____ _ __ _ _ /\ / ' __ _ () __ __ _ \ \ \ ( ( )__ | '_ | '| | ' / ` | \ \ \ / )| |)| | | | | || (| | ) ) ) ) ' || .|| ||| |, | / / / / =========||==============|/=//_// :: Spring Boot :: (v3.1.1)

2023-06-28T18:00:44.913-03:00 INFO 13752 --- [ restartedMain] c.e.screenmatch.ScreenmatchApplication : Starting ScreenmatchApplication using Java 20.0.1 with PID 13752 (C:\Users\rayan\Downloads\screenmatch\screenmatch\target\classes started by rayan in C:\Users\rayan\Downloads\screenmatch) 2023-06-28T18:00:44.915-03:00 INFO 13752 --- [ restartedMain] c.e.screenmatch.ScreenmatchApplication : No active profile set, falling back to 1 default profile: "default" 2023-06-28T18:00:44.983-03:00 INFO 13752 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2023-06-28T18:00:44.984-03:00 INFO 13752 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' 2023-06-28T18:00:46.194-03:00 INFO 13752 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2023-06-28T18:00:46.204-03:00 INFO 13752 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2023-06-28T18:00:46.205-03:00 INFO 13752 --- [ restartedMain] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.10] 2023-06-28T18:00:46.264-03:00 INFO 13752 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2023-06-28T18:00:46.266-03:00 INFO 13752 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1280 ms 2023-06-28T18:00:46.615-03:00 INFO 13752 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729 2023-06-28T18:00:46.658-03:00 INFO 13752 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2023-06-28T18:00:46.669-03:00 INFO 13752 --- [ restartedMain] c.e.screenmatch.ScreenmatchApplication : Started ScreenmatchApplication in 2.101 seconds (process running for 2.615)

Process finished with exit code 130

No seu log aparece no final:

023-06-28T18:00:46.658-03:00 INFO 13752 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 
2023-06-28T18:00:46.669-03:00 INFO 13752 --- [ restartedMain] c.e.screenmatch.ScreenmatchApplication : Started ScreenmatchApplication in 2.101 seconds (process running for 2.615)

Isso indica que o servidor foi inicializado corretamente. Mas logo na sequência, na última linha, aparece:

Process finished with exit code 130

Isso indica que a aplicação foi finalizada e por isso você não consegue acessar no navegador.

Esse código 130 indica que o processo foi finalizado manualmente pelo usuário. Geralmente acontece quando você aperta CTRL + C ou CTRL + D no intellij, que são atalhos para finalizar a aplicação.

Ah, interessante! Eu realmente tinha salvado. Mas, ainda ocorre erro no meu https://localhost:8080/filmes

Rodrigo, eu continuei com as aulas e não estou salvando agora (para não ter problema com o Process finished). Porém, ainda ocorre erro no meu https://localhost:8080/filmes sendo que agora apareceu isto:

** Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level. **

Segue print completo Part1 (porque ultrapassou o limite de caracteres):

*

. ____ _ __ _ _ /\ / _' __ _ ()_ __ __ _ \ \ \ ( ( )__ | '_ | '| | ' / ` | \ \ \ \/ _)| |)| | | | | || (_| | ) ) ) ) ' || .|| ||| |_, | / / / / =========||==============|_/=//_// :: Spring Boot :: (v3.1.1)

2023-06-29T08:57:25.515-03:00 INFO 6336 --- [ restartedMain] c.e.screenmatch.ScreenmatchApplication : Starting ScreenmatchApplication using Java 20.0.1 with PID 6336 (C:\Users\rayan\Downloads\screenmatch\screenmatch\target\classes started by rayan in C:\Users\rayan\Downloads\screenmatch) 2023-06-29T08:57:25.519-03:00 INFO 6336 --- [ restartedMain] c.e.screenmatch.ScreenmatchApplication : No active profile set, falling back to 1 default profile: "default" 2023-06-29T08:57:25.835-03:00 INFO 6336 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2023-06-29T08:57:25.835-03:00 INFO 6336 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' 2023-06-29T08:57:26.809-03:00 INFO 6336 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2023-06-29T08:57:26.818-03:00 INFO 6336 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2023-06-29T08:57:26.818-03:00 INFO 6336 --- [ restartedMain] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.10] 2023-06-29T08:57:26.877-03:00 INFO 6336 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2023-06-29T08:57:26.879-03:00 INFO 6336 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1043 ms 2023-06-29T08:57:27.331-03:00 INFO 6336 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729 2023-06-29T08:57:27.374-03:00 INFO 6336 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2023-06-29T08:57:27.385-03:00 INFO 6336 --- [ restartedMain] c.e.screenmatch.ScreenmatchApplication : Started ScreenmatchApplication in 2.228 seconds (process running for 2.68) 2023-06-29T08:57:47.123-03:00 INFO 6336 --- [nio-8080-exec-2] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.

java.lang.IllegalArgumentException: Invalid character found in method name [0x160x030x010x020x000x010x000x010xfc0x030x030x910xc9@0xe70xb0$0xcb0xc20x920xd0OQ0xf4`0xbd0xcf"0x00x0xf30xa10x810x1c0xc20xd1"v0xa60x85-0x080xd9 ]. HTTP method names must be tokens at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:407) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:264) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:894) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at java.base/java.lang.Thread.run(Thread.java:1623) ~[na:na]

2023-06-29T08:57:47.123-03:00 INFO 6336 --- [nio-8080-exec-1] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.

java.lang.IllegalArgumentException: Invalid character found in method name [0x160x030x010x020x000x010x000x010xfc0x030x030x0d0x060xa70x840x180x1c0xed0xe70xd680xfe0x9a0x190x98l0xb4I$R0x150xef0xe10xb3$0x140x9a0xa80x866(0x01> ]. HTTP method names must be tokens at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:407) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:264) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:894) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-10.1.10.jar:10.1.10] at java.base/java.lang.Thread.run(Thread.java:1623) ~[na:na]

solução!

Consegui resolver essa parte fazendo uns testes. Muito obrigada, Rodrigo!