Грешка при отваряне на базата данни OrientDB

Имам проблем с URL адреса, където се опитвам да хвана моята DB. Ето кода:

TransactionalGraph graph = new OrientGraph("/home/danicroque/Escritorio/demoCroque", "admin", "admin");

Ето грешката:

run:
may 20, 2016 2:49:46 AM com.orientechnologies.common.log.OLogManager log
INFORMACIÓN: OrientDB auto-config DISKCACHE=907MB (heap=846MB os=3.802MB disk=447.700MB)
Exception in thread "main" com.orientechnologies.orient.core.exception.ODatabaseException: Error on opening database '/home/danicroque/Escritorio/demoCroque'
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.<init>(ODatabaseDocumentTx.java:204)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.<init>(ODatabaseDocumentTx.java:168)
    at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.openOrCreate(OrientBaseGraph.java:1818)
    at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<init>(OrientBaseGraph.java:161)
    at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.<init>(OrientTransactionalGraph.java:102)
    at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.<init>(OrientTransactionalGraph.java:98)
    at com.tinkerpop.blueprints.impls.orient.OrientGraph.<init>(OrientGraph.java:103)
    at pruebatodook.PruebaTodoOk.run(PruebaTodoOk.java:23)
    at pruebatodook.PruebaTodoOk.main(PruebaTodoOk.java:16)
Caused by: com.orientechnologies.orient.core.exception.OConfigurationException: Error in database URL: the engine was not specified. Syntax is: <engine>:<db-type>:<db-name>[?<db-param>=<db-value>[&]]*. URL was: /home/danicroque/Escritorio/demoCroque
    at com.orientechnologies.orient.core.Orient.loadStorage(Orient.java:441)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.<init>(ODatabaseDocumentTx.java:187)
    ... 8 more
may 20, 2016 2:49:46 AM com.orientechnologies.common.log.OLogManager log
INFORMACIÓN: OrientDB Engine shutdown complete
/home/danicroque/.cache/netbeans/8.1/executor-snippets/run.xml:53: Java returned: 1
BUILD FAILED (total time: 1 second)

Опитвам се да стартирам този код в Ubuntu с Netbeans. Името на DB е demoCroque, а URL адресът е /home/Escritorio/demoCroque.

Как мога да разреша този проблем?


person Danicroque belmar    schedule 20.05.2016    source източник


Отговори (1)


Изглежда, че вашият URL е неправилно формиран.

Вижте тук: http://orientdb.com/docs/2.2/Console-Command-Connect.html

<database-url> Defines the URL of the database you want to connect to.
It uses the format <mode>:<path>

<mode> Defines the mode you want to use in connecting to the database.
It can be PLOCAL or REMOTE.

<path> Defines the path to the database.

Опитайте нещо подобно като URL адрес:

REMOTE:192.168.1.1/demoCroque

Or

PLOCAL:../home/Escritorio/demoCroque

Редактиране: за целите на тестването използвайте пълен път към файла, докато разберете, че работи правилно, например:

PLOCAL:C:/projects/myproject/Escritorio/demoCroque
person sorifiend    schedule 20.05.2016