Friday, April 17, 2015

Unable to get the hostName or IP address of the server when starting WSO2 Products

Today I faced an issue when a wso2 server that needed restarting did not start up, after shutting down due to the error

{org.apache.synapse.ServerConfigurationInformation} -  Unable to get the hostName or IP address of the server {org.apache.synapse.ServerConfigurationInformation} <hostname> : <hostname> : Name or service not known
at org.apache.synapse.ServerConfigurationInformation.initServerHostAndIP(
at org.apache.synapse.ServerConfigurationInformation.<init>(
at org.apache.synapse.ServerConfigurationInformationFactory.createServerConfigurationInformation(
at org.wso2.carbon.mediation.initializer.ServiceBusInitializer.initESB(
at org.wso2.carbon.mediation.initializer.ServiceBusInitializer.activate(

The issue in my case was that it was not a wso2 bug. It is an issue with the machine.

The OS I was using was ubuntu. The issue was that the hostname was not correctly set.

The easy way  - temporary fix

1) Run the following command. (assuming the hostname you want to set is abc001)

                    #    hostname abc001

2) To verify the hostname just run the following command

                           # hostname

it should output the hostname that we set as the output.

Proper fix

1) We need to fix this properly. In that case, we need to change the /sysconfig/network file.

open this file as sudo or super user, and change the hostname in that file to be the hostname you require.


2) Then you need to update the etc/hosts file, to reflect this change. you should map the entry


                      <local-ip> abc001

3) After that you need to restart the network service.

                   #service network restart
                   #/etc/init.d/network restart

4) Then verify the hostname has been set by running the command

                    # hostname



No comments:

Post a Comment