GriddB Java Client Error

0

I have some Java code that I am running. My Griddb is running in a docker container. When I execute the program, I get a runtime error that there is a SocketTimeoutException while at the same time, the program keeps going in an infinite loop, throwing the same error at intervals. My GriddB server already running on docker. Could this error be from how the code is structured or the griddb server itself and how do I fix this? The screenshot below shows the error I am getting.

Below is the code

package org.griddb;

import com.toshiba.mwcloud.gs.*;

import java.util.Date;
import java.util.Properties;

public class GridDBTest {

static class Person {
    @RowKey
    public String name;
    private int age;
}

static class HeartRate {
    @RowKey
    Date ts;
    int heartRate;
    String activity;
}


public static void main(String[] args) throws GSException {
    Properties props = new Properties();
    props.setProperty("notificationAddress", "239.0.0.1");
    props.setProperty("notificationPort", "31999");
    props.setProperty("clusterName", "defaultCluster");
    props.setProperty("user", "admin");
    props.setProperty("password", "admin");
    GridStore store = GridStoreFactory.getInstance().getGridStore(props);

    Collection<String, Person> people = store.putCollection("PEOPLE", Person.class);

    Query<Person> query = people.query("select * where name = 'John'");
    RowSet<Person> rs = query.fetch(false);
    Person person1 = new Person();
    person1.age=50;
    person1.name="John";
    TimeSeries<Person> personTimeSeries = store.putTimeSeries("Admin_"+person1.name, 
    Person.class);
    personTimeSeries.put(person1);
    while (rs.hasNext()) {
        // Update the searched Row
        Person person2 = rs.next();
        System.out.println("Name: "+ person2.name +" Age: "+ person2.age);
    }
    store.close();
}

Did you run your GridDB docker container to be attached to the network of the host? (ie network=host)? Or did you expose the port? Your error to me looks like it simply can’t find the running GridDB server, meaning the network port can’t be reached, likely meaning the port isn’t exposed