OrientDB 无法使用远程 java 获取图形实例

OrientDB can't get graph instance using remote from java

我创建了一个名为 "testing" 的数据库并启动了服务器,但是当我尝试使用 'remote' 从中获取图形实例时 ...

OrientGraphFactory factory = new OrientGraphFactory("REMOTE:localhost:2424/testing", "admin", "admin");
OrientGraph txGraph = factory.getTx();  <--- THIS LINE

...它给出了这个错误信息:

Exception in thread "main" java.lang.UnsupportedOperationException: Cannot check the existance of a database in a remote server. Please use the console or the OServerAdmin class. at com.orientechnologies.orient.client.remote.OStorageRemote.exists(OStorageRemote.java:282) at com.orientechnologies.orient.client.remote.OStorageRemoteThread.exists(OStorageRemoteThread.java:170) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.exists(ODatabaseDocumentTx.java:1160) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.openOrCreate(OrientBaseGraph.java:1902) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.(OrientBaseGraph.java:181) at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.(OrientTransactionalGraph.java:102) at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.(OrientTransactionalGraph.java:98) at com.tinkerpop.blueprints.impls.orient.OrientGraph.(OrientGraph.java:77) at testing.testing.main(testing.java:202)

OServerAdmin class 也没有提供任何实用程序来获取图形实例。

在 OrientDB v2.1.9 上测试

知道如何解决这个问题吗?

如果你想在远程模式下打开数据库,你必须使用 OServerAdmin class 然后你可以使用 OrientGraphFactory。 我给你附上了一个例子。