"Address already in use" error with Spring Boot services

Talend Version          6.x

Summary

"java.net.BindException: Address already in use" error when running multiple Spring Boot services at the same time.
Additional Versions  
Product ESB
Component Spring Boot service
Problem Description

The following error is thrown when running another instance of a Spring Boot service:

[ERROR]: org.apache.coyote.http11.Http11NioProtocol - Failed to start end point associated with Protocol Handler ["http-nio-8080"] 
java.net.BindException: Address already in use
Problem root cause

Spring Boot uses embedded Tomcat configured with a default port. When attempting to run two or more Spring Boot services in the same machine, they will try to use the same default port.

Solution or Workaround

To change the port, use the Java property -Dserver.port in the command.

For example:

java -Dserver.port=7070 -jar mySpringBootRoute.jar

or

java -jar mySpringBootRoute.jar --server.port=7070
JIRA ticket number  
Version history
Revision #:
3 of 3
Last update:
‎09-05-2017 01:43 PM
Updated by:
 
Labels (1)
Contributors
Tags (1)