Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Erro na hora clicar no Run

. __ _ __ _ _ /\ / _'_ _ _ _()_ _ __ _ \ \ \ ( ( )___ | ' | '| | ' / ` | \ \ \ \/ ___)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||_| |_, | / / / / =========||==============|__/=//// :: Spring Boot :: (v2.7.2)

2022-08-10 15:46:35.215 INFO 10996 --- [ main] br.com.alura.forum.ForumApplication : Starting ForumApplication using Java 17.0.3.1 on WNB035963CPS with PID 10996 (C:\Users\mdraetta\Downloads\forum\target\classes started by mdraetta in C:\Users\mdraetta\Downloads\forum) 2022-08-10 15:46:35.217 INFO 10996 --- [ main] br.com.alura.forum.ForumApplication : No active profile set, falling back to 1 default profile: "default" 2022-08-10 15:46:36.020 INFO 10996 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2022-08-10 15:46:36.029 INFO 10996 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2022-08-10 15:46:36.029 INFO 10996 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.65] 2022-08-10 15:46:36.138 INFO 10996 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2022-08-10 15:46:36.139 INFO 10996 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 881 ms 2022-08-10 15:46:36.413 WARN 10996 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.PortInUseException: Port 8080 is already in use 2022-08-10 15:46:36.416 INFO 10996 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2022-08-10 15:46:36.425 INFO 10996 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2022-08-10 15:46:36.439 ERROR 10996 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Web server failed to start. Port 8080 was already in use.

Action:

Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.

O que fazer

1 resposta
solução!

Oi, Marcelo, como vai?

O erro parece estar acontecendo porque a porta 8080 que o Spring Boot utiliza por padrão para subir o código já está sendo utilizada por algum outro processo do seu computador. Uma forma de tentar solucionar esse problema seria acessar o arquivo application.properties que fica dentro da pasta resources, e dentro deste arquivo adicionar a seguinte linha: server.port=8081. Essa linha irá alterar a porta padrão 8080 pela 8081.

Espero que ajude.

Abraços e bons estudos!