Search code examples
scalaorientdb

com.orientechnologies.orient.core.exception.OConfigurationException: Database 'TEST' is not configured on server


I setup a distributed version of Orient DB. The problem is that I cannot create a database using Scala API:

    <dependency>
        <groupId>com.orientechnologies</groupId>
        <artifactId>orientdb-graphdb</artifactId>
        <version>2.2.2</version>
    </dependency>

val uri: String = "remote:XXX.XX.XX.XX/database/TEST"
val username: String = "root"
val password: String = "123"
val factory: OrientGraphFactory = new OrientGraphFactory(uri,username,password)
val graph: OrientGraph = factory.getTx()

When I run this code, I get the error:

INFO: Registered the new available server 'XXX.XX.XX.XX:2424'
Exception in thread "main" com.orientechnologies.orient.core.exception.OConfigurationException: Database 'TEST' is not configured on server (home=/root/orientdb/databases/)

If I go to one of the nodes of DB and run ./bin/console.sh, and then:

create database remote:XXX.XX.XX.XX/database/TEST root 123 memory

and then re-execute the Scala code, then it works fine:

Apr 19, 2018 6:37:14 PM com.orientechnologies.common.log.OLogManager log
INFO: Registered the new available server 'XXX.XX.XX.XX:2424'
Apr 19, 2018 6:37:14 PM com.orientechnologies.common.log.OLogManager log
INFO: Registered the new available server '192.168.0.14:2424'
Apr 19, 2018 6:37:14 PM com.orientechnologies.common.log.OLogManager log
INFO: Registered the new available server '192.168.0.17:2424'

What am I doing wrong in Scala? Is it possible to create database using Scala API?


Solution

  • As you can see in this page: https://orientdb.com/docs/last/Programming-Language-Bindings.html Scala is supported by OrientDB. Memory Storage is local and endures only as long as the JVM is running. Could you try to create a DB which type is plocal, and then, run your code again? In case you would know something more about storage: https://orientdb.com/docs/last/Storages.html

    Hope it helps.

    Regards