ElasticSearch in Java (TransportClient): NoNodeAvailableException[None of the configured nodesare available: []]

New code, which does exactly the same thing, but separates out the problem stuff better:

import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.NoNodeAvailableException;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;

import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;

public class TrivialClient {

    public static void main(String[] args) throws UnknownHostException {
        InetSocketTransportAddress transportAddress = new InetSocketTransportAddress(
                InetAddress.getLocalHost(), 9300);
        createClientPrintResponse("getLocalHost", transportAddress);

        transportAddress = new InetSocketTransportAddress(
                        InetAddress.getByName("localhost"), 9300);

        createClientPrintResponse("getByName(\"localhost\")", transportAddress);

//Does not compile in ElasticSearch 2.0
//        transportAddress = new InetSocketTransportAddress("localhost", 9200);
//        createClientPrintResponse("getByName(\"localhost\")", transportAddress);

        transportAddress = new InetSocketTransportAddress(
                InetAddress.getByAddress(new byte[]{127, 0, 0, 1}), 9300);
        createClientPrintResponse("getByAddress(new byte[] {127, 0, 0, 1})", transportAddress);

        transportAddress =
                new InetSocketTransportAddress(new InetSocketAddress("127.0.0.1", 9300));
        createClientPrintResponse("InetSocketAddress", transportAddress);
    }

    private static void createClientPrintResponse(String description,
                                                  InetSocketTransportAddress transportAddress) {
        Settings settings = Settings.settingsBuilder()
                .put("cluster.name", "epsteinj-elasticsearch-local").build();
        Client client;
        client = TransportClient.builder().settings(settings).build().
                addTransportAddress(transportAddress);
        try {
            GetResponse response = client.prepareGet("comicbook", "superhero", "1").get();
            System.out.println(description + ": " + response);
        } catch (NoNodeAvailableException e) {
            System.out.println(description + ": " + e);
            //e.printStackTrace();
        }
    }
}

Output without stack traces:

getLocalHost: NoNodeAvailableException[None of the configured nodes are available: []]
getByName("localhost"): NoNodeAvailableException[None of the configured nodes are available: []]
getByAddress(new byte[] {127, 0, 0, 1}): NoNodeAvailableException[None of the configured nodes are available: []]
InetSocketAddress: NoNodeAvailableException[None of the configured nodes are available: []]

Stack trace:

NoNodeAvailableException[None of the configured nodes are available: []]
getLocalHost: NoNodeAvailableException[None of the configured nodes are available: []]
    at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:280)
    at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:197)
    at org.elasticsearch.client.transport.support.TransportProxyClient.execute(TransportProxyClient.java:55)
    at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:272)
    at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:347)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:85)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:59)
    at org.elasticsearch.action.ActionRequestBuilder.get(ActionRequestBuilder.java:67)
    at springes.esonly.TrivialClient.createClientPrintResponse(TrivialClient.java:47)
    at springes.esonly.TrivialClient.main(TrivialClient.java:19)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)