Ya estoy inscrito ¿Todavía no tienes acceso? Nuestros Planes
Ya estoy inscrito ¿Todavía no tienes acceso? Nuestros Planes
1
respuesta

Configure mi ambiente pero me arrojo este error.

. ____ _ __ _ _
/\ / _' __ _ ()_ __ __ _ \ \ \
( ( )_
_ | '_ | '| | ' / ` | \ \ \
\/ _)| |)| | | | | || (_| | ) ) ) )
' |
| .|| ||| |_, | / / / /
=========|
|==============|_/=//_//

:: Spring Boot :: (v3.4.8)

2025-07-25T20:22:33.052-04:00 INFO 13588 --- [api] [ restartedMain] med.voll.api.ApiApplication : Starting ApiApplication using Java 17.0.12 with PID 13588 (C:\Users\Omar\Desktop\Spring Boot 3 desarrolla una API REST en Java\api\target\classes started by Omar in C:\Users\Omar\Desktop\Spring Boot 3 desarrolla una API REST en Java\api)
2025-07-25T20:22:33.068-04:00 INFO 13588 --- [api] [ restartedMain] med.voll.api.ApiApplication : No active profile set, falling back to 1 default profile: "default"
2025-07-25T20:22:33.223-04:00 INFO 13588 --- [api] [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2025-07-25T20:22:33.223-04:00 INFO 13588 --- [api] [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2025-07-25T20:22:34.410-04:00 INFO 13588 --- [api] [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8080 (http)
2025-07-25T20:22:34.425-04:00 INFO 13588 --- [api] [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2025-07-25T20:22:34.425-04:00 INFO 13588 --- [api] [ restartedMain] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.43]
2025-07-25T20:22:34.488-04:00 INFO 13588 --- [api] [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2025-07-25T20:22:34.488-04:00 INFO 13588 --- [api] [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1265 ms
2025-07-25T20:22:34.935-04:00 INFO 13588 --- [api] [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2025-07-25T20:22:34.950-04:00 WARN 13588 --- [api] [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'
2025-07-25T20:22:34.966-04:00 INFO 13588 --- [api] [ restartedMain] .s.b.a.l.ConditionEvaluationReportLogger :

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2025-07-25T20:22:34.981-04:00 ERROR 13588 --- [api] [ restartedMain] 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.

Process finished with exit code 0


//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.springframework.boot.diagnostics;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.util.StringUtils;

public final class LoggingFailureAnalysisReporter implements FailureAnalysisReporter {
private static final Log logger = LogFactory.getLog(LoggingFailureAnalysisReporter.class);

public LoggingFailureAnalysisReporter() {
}

public void report(FailureAnalysis failureAnalysis) {
    if (logger.isDebugEnabled()) {
        logger.debug("Application failed to start due to an exception", failureAnalysis.getCause());
    }

    if (logger.isErrorEnabled()) {
        logger.error(this.buildMessage(failureAnalysis));
    }

}

private String buildMessage(FailureAnalysis failureAnalysis) {
    StringBuilder builder = new StringBuilder();
    builder.append(String.format("%n%n"));
    builder.append(String.format("***************************%n"));
    builder.append(String.format("APPLICATION FAILED TO START%n"));
    builder.append(String.format("***************************%n%n"));
    builder.append(String.format("Description:%n%n"));
    builder.append(String.format("%s%n", failureAnalysis.getDescription()));
    if (StringUtils.hasText(failureAnalysis.getAction())) {
        builder.append(String.format("%nAction:%n%n"));
        builder.append(String.format("%s%n", failureAnalysis.getAction()));
    }

    return builder.toString();
}

}

1 respuesta

Hola, Omar.

Parece que estás enfrentando un problema común al iniciar tu aplicación Spring Boot. El error indica que el servidor web no pudo iniciarse porque el puerto 8080 ya está en uso. Esto significa que otro proceso está utilizando ese puerto en tu máquina.

Aquí te dejo algunas sugerencias para resolver este problema:

  1. Identificar el proceso que está usando el puerto 8080:

    • En Windows, puedes abrir el símbolo del sistema y ejecutar el siguiente comando para encontrar el ID del proceso (PID) que está usando el puerto 8080:
      netstat -ano | findstr :8080
      
    • Esto te dará una lista de procesos. Busca el PID asociado y luego puedes detenerlo usando:
      taskkill /PID <PID> /F
      
    • En macOS o Linux, puedes usar:
      lsof -i :8080
      
    • Luego, mata el proceso con:
      kill -9 <PID>
      
  2. Cambiar el puerto de tu aplicación Spring Boot:

    • Abre el archivo application.properties o application.yml de tu proyecto y cambia el puerto predeterminado agregando la siguiente línea:
      server.port=8081
      
    • Esto configurará tu aplicación para que se ejecute en el puerto 8081 en lugar de 8080.

Ambas soluciones son válidas, y puedes elegir la que consideres más conveniente. Espero que esto te ayude a resolver el problema.

¡Espero haber ayudado y buenos estudios!