1

我已经安装了 Tinkerpop 3.0 M4 和 Gremlin 控制台,都是 3.0 M4。我无法执行以下操作:

1)加载已经存在的数据库,2)创建经典数据库。

通过 Tinkerpop 3,数据库在 Java 中运行良好,只是 Gremlin 控制台不是。在打开数据库时,我在安装 OrientDB 时遇到了与 Gremlin 2.6 相同的问题,因此这不是由于 OrientDB 2.0M2 和 Grails 2.6 或 3.0M4(也不是 M5)之间的版本不兼容。我不知道是什么问题。

1)这是我在 Gremlin 中给出的打开数据库的命令:

g = new OrientGraph("local:/opt/orientdb/databases/dbname", "user", "password");

这是我得到的例外:

groovysh_evaluate: 3: unable to resolve class OrintGraph
@ line 3, column 5.
g = new OrintGraph("local:/opt/orientdb/databases/circletask");
   ^

1 error
Display stack trace? [yN] y
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
groovysh_evaluate: 3: unable to resolve class OrintGraph
 @ line 3, column 5.
   g = new OrintGraph("local:/opt/orientdb/databases/circletask");
   ^

1 error

    at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:309)
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:938)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:585)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:534)
    at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:286)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:259)
    at groovy.lang.GroovyShell.parseClass(GroovyShell.java:674)
    at groovy.lang.GroovyShell.parse(GroovyShell.java:686)
    at groovy.lang.GroovyShell.parse(GroovyShell.java:722)
    at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:62)
    at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:159)
    at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:121)
    at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:93)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
    at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:130)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:150)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:123)
    at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:57)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:130)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:150)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:83)
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
    at com.tinkerpop.gremlin.console.Console.<init>(Console.groovy:99)
    at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:636)
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
    at com.tinkerpop.gremlin.console.Console.main(Console.groovy:230)

2)这是创建教程数据库的命令:

gremlin> Graph g = TinkerFactory.createClassic();

这是我得到的例外:

No such property: TinkerFactory for class: groovysh_evaluate

groovy.lang.MissingPropertyException: No such property: TinkerFactory for class: groovysh_evaluate
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:51)
    at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
    at groovysh_evaluate.run(groovysh_evaluate:3)
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
    at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:68)
    at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:159)
    at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:121)
    at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:93)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
    at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:130)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:150)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:123)
    at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:57)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:130)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:150)
    at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:83)
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
    at com.tinkerpop.gremlin.console.Console.<init>(Console.groovy:99)
    at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:636)
    at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
    at com.tinkerpop.gremlin.console.Console.main(Console.groovy:230)
4

3 回答 3

2

我发现该插件默认情况下未按预期激活:

gremlin> :plugin list
         ==>tinkerpop.server
         ==>tinkerpop.gephi
         ==>tinkerpop.sugar
         ==>tinkerpop.utilities
         ==>tinkerpop.tinkergraph

解决了这个问题:

:plugin use tinkerpop.server
:plugin use tinkerpop.tinkergraph
:plugin use tinkerpop.utilities
于 2014-11-16T03:18:41.930 回答
1

目前还没有针对 TinkerPop3 的 OrientDB 实现。

于 2014-11-16T11:41:04.857 回答
1

错误说:

groovysh_evaluate: 3: unable to resolve class OrintGraph
 @ line 3, column 5.
   g = new OrintGraph("local:/opt/orientdb/databases/circletask");

那么您似乎拼错了 OrintGraph 中的 OrientGraph 类?尝试使用 OrientGraph。

于 2014-11-16T10:38:11.167 回答