0

I am upgrading from spring boot 2.2.2 to 2.3.2.RELEASE and getting below error. I am sure that it is not related to the port which is already in use. Also, I have changed the logging from logging.file to logging.file.name as per spring boot 2.3.2

WARN  [framework_5_5][traceId:][spanId:][parentSpanId:][spanExportable:][bt:@build.time@][cbn:@current.branch@][main][2020-08-20 15:22:29,317]- org.springframework.context.support.AbstractApplicationContext.refresh:Line 559 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.embedded.tomcat.ConnectorStartFailedException: Connector configured to listen on port 10090 failed to start
INFO  [framework_5_5][traceId:][spanId:][parentSpanId:][spanExportable:][bt:@build.time@][cbn:@current.branch@][main][2020-08-20 15:22:29,321]- org.springframework.scheduling.concurrent.ExecutorConfigurationSupport.shutdown:Line 218 - Shutting down ExecutorService 'applicationTaskExecutor'
INFO  [framework_5_5][traceId:][spanId:][parentSpanId:][spanExportable:][bt:@build.time@][cbn:@current.branch@][main][2020-08-20 15:22:29,324]- com.zaxxer.hikari.HikariDataSource.close:Line 350 - HikariPool-1 - Shutdown initiated...
INFO  [framework_5_5][traceId:][spanId:][parentSpanId:][spanExportable:][bt:@build.time@][cbn:@current.branch@][main][2020-08-20 15:22:29,329]- com.zaxxer.hikari.HikariDataSource.close:Line 352 - HikariPool-1 - Shutdown completed.
INFO  [framework_5_5][traceId:][spanId:][parentSpanId:][spanExportable:][bt:@build.time@][cbn:@current.branch@][main][2020-08-20 15:22:29,329]- com.zaxxer.hikari.HikariDataSource.close:Line 350 - HikariPool-2 - Shutdown initiated...
INFO  [framework_5_5][traceId:][spanId:][parentSpanId:][spanExportable:][bt:@build.time@][cbn:@current.branch@][main][2020-08-20 15:22:29,337]- com.zaxxer.hikari.HikariDataSource.close:Line 352 - HikariPool-2 - Shutdown completed.
INFO  [framework_5_5][traceId:][spanId:][parentSpanId:][spanExportable:][bt:@build.time@][cbn:@current.branch@][main][2020-08-20 15:22:29,353]- org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener.logMessage:Line 136 - 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
ERROR [framework_5_5][traceId:][spanId:][parentSpanId:][spanExportable:][bt:@build.time@][cbn:@current.branch@][main][2020-08-13 19:20:31,769]- org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter.report:Line 40 - 
***************************
APPLICATION FAILED TO START
***************************

Description:

The Tomcat connector configured to listen on port 10090 failed to start. The port may already be in use or the connector may be misconfigured.

Action:

Verify the connector's configuration, identify and stop any process that's listening on port 10090, or configure this application to listen on another port.
Ravi
  • 195
  • 3
  • 15

3 Answers3

1

configure this application to listen on another port.

Above errors occurs when application is already running.

If you are using Eclipse or Intellij, could restart and run the application.

  • No, it is not the problem. As soon as I change the spring boot version to 2.2.2 then it works fine. As I mentioned in the question I am sure it is not related to port but the version. Also, I have restarted eclipse. – Ravi Aug 14 '20 at 04:13
  • One more thing is that I am using jdk11 – Ravi Aug 14 '20 at 04:29
0

I have added ((AbstractAjpProtocol<Long>)ajpConnector.getProtocolHandler()).setSecretRequired(false); with ajp connector and issue is resolved

Updated: You need to add this line of code to make it work with apache

protocol.setAddress(new InetSocketAddress(0).getAddress());

Port zero will let the system pick up an ephemeral port in a bind operation

Ravi
  • 195
  • 3
  • 15
0

As i am not allowed to enter comment putting it here?

What is the solution for this.

Viral Kondhia
  • 51
  • 1
  • 10