Connecting to a Elasticsearch running on a remote host

May be your port 9300 is not exposed.

Anyway, I'd recommend using the High Level Rest client instead. It uses port 9200 and is the preferred way to connect with Java to your elasticsearch cluster.