When working with WSO2 Carbon Platform products you should (and will) come across instances where you might need to start more than one product or an instance of the same product. If we take an example you try and start 2 instance of WSO2 ESB (Enterprise Service Bus). ESB can be downloaded from here. So unzip the distribution go to “[CARBON_HOME]/bin” and run ./wso2server.sh. The server will start running and will deploy its services and initial databases. so once that is done we will start the next ESB Server and you will should get this error.
WARN - PassThroughHttpSSLListener System may be unstable: HTTPS ListeningIOReactor encountered a checked exception : Address already in use java.net.BindException: Address already in use
ERROR - JMXServerManager Could not create the RMI local registry java.rmi.server.ExportException: Port already in use: 9999; nested exception is: java.net.BindException: Address already in use
ERROR – JMXServerManager Could not initialize RMI server java.rmi.server.ExportException: Port already in use: 11111; nested exception is: java.net.BindException: Address already in use
This is due to the servers both starting on default ports. So, to prevent this from happening we do the following;
- Go to WSO2 ESB server 2 (the server where you got this exceptions) and find “[CARBON_HOME]/repository/conf/carbon.xml”
- Find <Offset>0</Offset> where default will be set to “0”
- Change the value from 0 to 10 (or any number you would prefer)
- try restarting the server.
The server should start without any issue. The <Offset>0</Offset> parameter will shift all the default ports by the Offset value specified. If you set 10 as the Offset value all the default server ports will increment by 10.