Place names.txt file inside bundle.you can find names.txt file inside elasticsearch.jar.Add following code where you create client instance.
Thread.currentThread().setContextClassLoader(*classname*.class.getClassLoader());
Builder settings = ImmutableSettings.settingsBuilder().put("cluster.name", esHosts);
settings.put("path.conf", path_of_names.txt);
TransportClient transportClient = new TransportClient(settings);
I added 2 jars to my class_path, they are elasticsearch.jar,lucene.jar. Version of jars must be same as version of Elasticsearch.
now it works like charm..