title: Socket connect exception saying connection refused
body: <p>I am building a spring boot application, which has multiple micro-services which are being used by one main service. Services are created as maven modules and I am using <code>intelliJ IDEA</code> 15 with trial period. Now when I am trying to run the service I am getting the following error. I think my tomcat server is not running but I am not getting how to check and if this is the problem then how to resolve. I have included tomcat dependency in <code>pom.xml</code>.</p>
  
  <p>the class which I am running is this-></p>
  
  <p><strong>AlpsWsApplication.java</strong></p>
  
  <pre><code>@SpringBootApplication
  public class AlpsWsApplication {
      private static final Logger logger = LoggerFactory
              .getLogger(AlpsWsApplication.class);
      public static void main(String[] args) {
          SpringApplication.run(AlpsWsApplication.class, args);
      }
  }
  </code></pre>
  
  <p>with this there are hibernate, Apache qpid configuration files.</p>
  
  <p>Stack trace:</p>
  
  <pre><code>ERROR 10 Mar 2016 14:01:10,185 [main] org.springframework.boot.SpringApplication: Application startup failed
  com.ecwid.consul.transport.TransportException: java.net.ConnectException: Connection refused
      at com.ecwid.consul.transport.DefaultHttpTransport.executeRequest(DefaultHttpTransport.java:87)
      at com.ecwid.consul.transport.DefaultHttpTransport.makeGetRequest(DefaultHttpTransport.java:46)
      at com.ecwid.consul.v1.ConsulRawClient.makeGetRequest(ConsulRawClient.java:66)
      at com.ecwid.consul.v1.kv.KeyValueConsulClient.getKVValues(KeyValueConsulClient.java:135)
      at com.ecwid.consul.v1.kv.KeyValueConsulClient.getKVValues(KeyValueConsulClient.java:128)
      at com.ecwid.consul.v1.ConsulClient.getKVValues(ConsulClient.java:346)
      at org.springframework.cloud.consul.config.ConsulPropertySource.init(ConsulPropertySource.java:57)
      at org.springframework.cloud.consul.config.ConsulPropertySourceLocator.locate(ConsulPropertySourceLocator.java:70)
      at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:88)
      at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:628)
      at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:328)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:295)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1112)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1101)
      at com.alps.AlpsWsApplication.main(AlpsWsApplication.java:13)
  Caused by: java.net.ConnectException: Connection refused
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
      at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
      at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      at java.net.Socket.connect(Socket.java:589)
      at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:117)
      at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177)
      at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)
      at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)
      at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)
      at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:220)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:164)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:139)
      at com.ecwid.consul.transport.DefaultHttpTransport.executeRequest(DefaultHttpTransport.java:71)
      ... 14 more
  </code></pre>