I'm creating cluster dynamically in `xtend`/`Java`

```
for (int i : 0 ..< DistributorClusters.length) {
    val clusterName = classnames.get(i) + clusterSuffix;
    database.command(
                new OCommandSQL('''ALTER CLASS «classnames.get(i)» ADDCLUSTER «clusterName»''')).execute();
        }

```

Then I create I add the `oRole` and Grant the security to the new `oRole`

```
val queryOroleCreation = '''INSERT INTO orole SET name = '«clusterSuffix»', mode = 0, inheritedRole = (SELECT FROM orole WHERE name = 'Default')''';
        val ODocument result = database.command(new OCommandSQL(queryOroleCreation)).execute();
        for (int i : 0 ..< classnames.length) {
            database.command(
                new OCommandSQL(
                    '''GRANT ALL ON database.cluster.«classnames.get(i)»«clusterSuffix» TO «clusterSuffix»''')).
                execute();
        }

```

Finally I try to save a `JsonObject` to one of the newly created cluster. I checked in the database and the cluster exists.

```
        val doc = new ODocument();
        doc.fromJSON(jsonToSave.toString());

        val savedDoc = database.save(doc, "ClassName"+clusterSuffix);
        database.commit();

```

But Orient returns the following error :

```
SEVERE: java.lang.IllegalArgumentException: Cluster name 'cluster:ClassNameclusterSuffix' is not configured

```

**My Question :**
What causes that exception? And can you add values to new cluster created?

**Edit**

The `doc` object contains reference to other classes. i.e:

```
{
    @class:"Customer",
    @version:0,
    name:"Kwik-E-Mart",
    user : {
        @class:"User",
        @version:0,
        username: "Apu",
        firstName:"Apu",
        lastName:"Nahasapeemapetilon"
    }
}

```

The user gets created in the default cluster, but the `customer` throws the exception.