ServiceNotAvailableException even after successful waitUntilReady()

That looks like it should work. What version of the SDK do you have? waitUntilReady() is pretty reliable, but it did have some issues that were fixed. What is connectionString? What does SDK Doctor report about the cluster? If you loop on the cluster.query() operation, does it eventually succeed?