【问题标题】:Tinkerpop Gremlin console not workingTinkerpop Gremlin 控制台不工作
【发布时间】:2014-11-16 02:16:32
【问题描述】:

我已经安装了 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)

【问题讨论】:

    标签: orientdb gremlin tinkerpop


    【解决方案1】:

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

    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
    

    【讨论】:

      【解决方案2】:

      错误说:

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

      看来您在 OrintGraph 中拼错了 OrientGraph 类?尝试使用 OrientGraph。

      【讨论】:

        【解决方案3】:

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

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2020-08-31
          • 2016-11-04
          • 1970-01-01
          • 2019-08-29
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多