This is the line of code, I am using :-
@Grab(‘com.couchbase.client:java-client:2.2.7’)
//2.2.6
import java.util.concurrent.CountDownLatch;
import com.couchbase.client.java.Bucket;
import com.couchbase.client.java.Cluster;
import com.couchbase.client.java.CouchbaseCluster;
import com.couchbase.client.java.document.JsonDocument;
import com.couchbase.client.java.document.json.JsonObject;
import com.couchbase.client.java.CouchbaseCluster
import com.couchbase.client.java.query.N1qlQuery;
import com.couchbase.client.java.query.N1qlQueryResult;
import com.couchbase.client.java.query.N1qlQueryRow;
import com.couchbase.client.java.query.SimpleN1qlQuery;
import com.couchbase.client.java.env.CouchbaseEnvironment;
import com.couchbase.client.java.env.DefaultCouchbaseEnvironment;
CouchbaseEnvironment env = DefaultCouchbaseEnvironment.builder().connectTimeout(20000).build();
def cluster = CouchbaseCluster.create(env, ip_Address);
def bucket = cluster.openBucket(bucket_name, bucket_password);
log.info “Connection done”
String queryString = "CREATE PRIMARY INDEX primInd
ON demo
"
SimpleN1qlQuery simpleQuery = N1qlQuery.simple(queryString);
N1qlQueryResult resultSet = bucket.query(simpleQuery);
log.info “Primary index created”
It gives above error at this line - N1qlQueryResult resultSet = bucket.query(simpleQuery);
Could you please help to replicate the issue?