Java client Select query fails

Executing select query with java client 3.0.26. Sometime it fetches the record and sometime it fails for the same query, It throws below exception

Exception in thread “main” com.aerospike.client.AerospikeException: Error Code 11: Query failed because cluster is empty. at com.aerospike.client.query.QueryExecutor.( at com.aerospike.client.query.QueryRecordExecutor.( at com.aerospike.client.AerospikeClient.query( at service.impl.AerospikeServiceImpl.executeQuery(

Here is my code to execute query Statement statement = new Statement(); statement.setNamespace(namespace); statement.setSetName(set); statement.setBinNames(bins); statement.setFilters(filter); RecordSet rs = client.query(null, statement);