Transport Client not getting connected 5.6.3 Java API

It sounds like x-pack is running.

Which might indicate that you need to pass a login/password as it is probably secured, no?

When you used the REST endpoint, did you pass some credentials?