2014-11-16 54 views
0

我已经安装了Tinkerpop 3.0 M4和Gremlin控制台,都是3.0 M4。 我不能做到以下几点:Tinkerpop Gremlin控制台不工作

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

数据库在Java thrugh Tinkerpop 3中正常工作,只是Gremlin控制台不是。 打开数据库时,我与OrientDB安装的Gremlin 2.6有同样的问题,所以它不是由于OrientDB 2.0M2和Grails 2.6或3.0M4(也不是M5)之间的版本不兼容。 我找不出什么问题。

1)这是我给的精怪命令打开数据库:

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)这是命令创建教程DB:

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) 

回答

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 
0

错误说:

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

因此,你似乎拼错OrintGraph类OrientGraph?尝试使用OrientGraph。

1

目前TinkerPop3没有OrientDB实施。