1

I was trying to run the springboot project at port 8082. But it is failing again and again. Please give me a feasible solution. Full Stacktrace:

.   ____          _            __ _ _

/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \

( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \

\\/  ___)| |_)| | | | | || (_| |  ) ) ) )

  '  |____| .__|_| |_|_| |_\__, | / / / /

=========|_|==============|___/=/_/_/_/

:: Spring Boot ::        (v2.2.2.RELEASE)



2019-12-26 18:02:23.947  INFO 3680 --- [  restartedMain] c.i.s.w.s.SpringBootFirstWebApplication  : Starting SpringBootFirstWebApplication on DESKTOP-BK9RRM4 with PID 3680 (C:\Users\zunayeed\springboot-workspace01\spring-boot-first-web-application\spring-boot-first-web-application\target\classes started by zunayeed in C:\Users\zunayeed\springboot-workspace01\spring-boot-first-web-application\spring-boot-first-web-application)

2019-12-26 18:02:23.953  INFO 3680 --- [  restartedMain] c.i.s.w.s.SpringBootFirstWebApplication  : No active profile set, falling back to default profiles: default

2019-12-26 18:02:24.294  INFO 3680 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable

2019-12-26 18:02:24.295  INFO 3680 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'

2019-12-26 18:02:29.465  INFO 3680 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8082 (http)

2019-12-26 18:02:29.514  INFO 3680 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]

2019-12-26 18:02:29.515  INFO 3680 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.29]

2019-12-26 18:02:29.926  INFO 3680 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext

2019-12-26 18:02:29.927 DEBUG 3680 --- [  restartedMain] o.s.web.context.ContextLoader            : Published root WebApplicationContext as ServletContext attribute with name [org.springframework.web.context.WebApplicationContext.ROOT]

2019-12-26 18:02:29.927  INFO 3680 --- [  restartedMain] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 5628 ms

2019-12-26 18:02:30.726  INFO 3680 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'

2019-12-26 18:02:30.744 DEBUG 3680 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerAdapter : ControllerAdvice beans: 0 @ModelAttribute, 0 @InitBinder, 1 RequestBodyAdvice, 1 ResponseBodyAdvice

2019-12-26 18:02:31.039 DEBUG 3680 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : 2 mappings in 'requestMappingHandlerMapping'

2019-12-26 18:02:31.130 DEBUG 3680 --- [  restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping  : Patterns [/webjars/**, /**] in 'resourceHandlerMapping'

2019-12-26 18:02:31.165 DEBUG 3680 --- [  restartedMain] .m.m.a.ExceptionHandlerExceptionResolver : ControllerAdvice beans: 0 @ExceptionHandler, 1 ResponseBodyAdvice

2019-12-26 18:02:31.345  WARN 3680 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : Unable to start LiveReload server

2019-12-26 18:02:31.811  INFO 3680 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]

2019-12-26 18:02:31.830  INFO 3680 --- [  restartedMain] ConditionEvaluationReportLoggingListener :



Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2019-12-26 18:02:31.832 ERROR 3680 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   :



***************************

APPLICATION FAILED TO START

***************************



Description:



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



Action:


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



2019-12-26 18:02:31.837  INFO 3680 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
Number945
  • 4,631
  • 8
  • 45
  • 83
Zunayeed Kamal
  • 111
  • 2
  • 6

2 Answers2

1

Description:

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

Action:

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

Possible causes:

  • Either you have already been running the application
  • Or another application is running in the same port

Solutions:

  • Configure the application to listen on another port(ex: 8081)

    If you are using applcation.properties,

    server.port=8081
    

    If you are using application.yml

    server:
       port: 8081
    
  • Identify and stop the process that's listening on a port(8082)

    and restart your application

Shekhar Rai
  • 2,008
  • 2
  • 22
  • 25
0

If you are using cmd or git bash , use the command :

netstat -ano

or further fine grain query :

nestat -ano | grep {port addr}  

(note : grep only works in linux or gitbash , use findstr for cmd)

to identiy all the PID s that are currently running , which uses the particular port address that you want to use in your application. If the PIDs are not relevant , you could kill the PIDs using the command kill -9 {pid}. After that you could start your application in the same port.

Another easy approach is to use another port address which is not used by any other application. Just set the property server.port=8086 in your application.properties, or pass it as an argument when you start the application.

Ananthapadmanabhan
  • 5,706
  • 6
  • 22
  • 39