我尝试使用OServerAdmin连接到OrientDB服务器(版本2.2.12)来创建新的图形数据库。
OServerAdmin serverAdmin = new OServerAdmin(" remote:localhost") .connect("根"" rootPWD&#34);
此代码适用于2.2.0 versin但现在因以下异常而失败:
java.lang.AbstractMethodError: com.orientechnologies.orient.core.engine.OEngineAbstract.startup()V
at com.orientechnologies.orient.client.remote.OEngineRemote.startup(OEngineRemote.java:60)
at com.orientechnologies.orient.core.Orient.initEngines(Orient.java:579)
at com.orientechnologies.orient.core.Orient.registerEngines(Orient.java:318)
at com.orientechnologies.orient.core.Orient.startup(Orient.java:232)
at com.orientechnologies.orient.core.Orient.<clinit>(Orient.java:97)
at com.orientechnologies.orient.core.storage.OStorageAbstract.<clinit>(OStorageAbstract.java:56)
at com.orientechnologies.orient.client.remote.OServerAdmin.<init>(OServerAdmin.java:64)
....
答案 0 :(得分:0)
我在2.2.10版本上试过你的代码:
import java.io.IOException;
import com.orientechnologies.orient.client.remote.OServerAdmin;
public class stack40216764 {
public static void main(String[] args) {
try {
OServerAdmin serverAdmin = new OServerAdmin("remote:localhost").connect("root","root");
if(serverAdmin.isConnected())
System.out.println("connected");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
我已经“连接”了输出而没有任何错误。 分享应用程序的完整代码。