Getting InvalidNamespace: Error 20,1: Partition map empty with java client only, go client is fine

Running a local aero server, the following code in go works (v7 sdk)

	cp := aero.NewClientPolicy()
	cp.User = ""
	cp.Password = ""
	cp.Timeout = 1 * time.Second
	ash := aero.NewHost("", 3000)
	client, err := aero.NewClientWithPolicyAndHost(cp, ash)
	if err != nil { fmt.Printf("Err: %v\n", err)}

	statement := aero.NewStatement("myns", "myset", "SessionID", "Time")
	qp := aero.NewQueryPolicy()
	qp.FilterExpression = aero.ExpEq(aero.ExpStringBin("SessionID"), aero.ExpStringVal("48e9bb5c-d2e1-4e1c-b6c2-9b9dfd271add"))
	recordset, err := client.Query(qp, statement)

	cnt := 0
	for res := range recordset.Results() {
		if res.Err != nil {
			fmt.Printf("%#v\n", res.Err)
		} else {
			fmt.Printf("%#v\n", *res.Record)
	fmt.Println("count of rows:", cnt)

but the following code in java fails (java8, aerospike-client-jdk8-8.1.1.jar)

        ClientPolicy cp = new ClientPolicy();
        Host h = new Host("", 3000);
        AerospikeClient client = new AerospikeClient(cp, h);

        Statement stmt = new Statement();
        stmt.setBinNames("SessionID", "Time");
        QueryPolicy qp = new QueryPolicy();
        qp.filterExp ="SessionID"), Exp.val("48e9bb5c-d2e1-4e1c-b6c2-9b9dfd271add")));

        try {
            RecordSet rs = client.query(qp, stmt);
            while ( {
                Record record = rs.getRecord();
                System.out.printf("rec=[%s]\n", record.bins);
        } catch (Exception e) {
            System.out.printf("err=[%s]\n", e);

The error is com.aerospike.client.AerospikeException$InvalidNamespace: Error 20,1: Partition map empty

at com.aerospike.client.query.PartitionTracker.assignPartitionsToNodes(
at com.aerospike.client.query.QueryPartitionExecutor.execute(
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$

Code seems the same, it’s not a server issue because the go client works. Any idea what I’m missing? Thanks.

There is an underlying cluster tend error that is preventing the client cluster from being formed. Enable client logging to find out why:

Node … 3000 refresh failed: java.lang.NoClassDefFoundError: gnu/crypto/util/Base64 at com.aerospike.client.util.Crypto.decodeBase64(

Missing jar was the problem, thanks for your help.

The gnu-crypto-2.0.1.jar dependency is not included in your classpath. “aerospike-client-jdk8-8.1.1.jar” does not include it’s dependencies.

Go to Aerospike Downloads | Aerospike and click on “JDK” jdk8 and “Library” “Jar with dependencies”. Then, click download. The resulting “aerospike-client-jdk8-8.1.1-jar-with-dependencies.jar” includes all client dependencies.

1 Like