我刚刚尝试从gremlin控制台运行框架上的简单演示:
TinkerGraph graph = TinkerGraphFactory.createTinkerGraph();
FramedGraphFactory factory = new FramedGraphFactory(new GremlinGroovyModule());在添加了一个import com.tinkerpop.frames.*; (是的,我的类路径中有修补程序框架)之后,控制台不识别FramedGraphFactory类。
事实上,如果我运行
gremlin> show classes命令,它回答说没有加载任何内容。有线索吗?
谢谢
PS详细信息:我在Ubuntu上,下载gremlin-groovy-2.4.0。
我还下载了框架jar,并设置了类路径:
echo $CLASSPATH
/home/dev/frames-2.5.0.jar然后启动gremlin和导入帧:
import com.tinkerpop.frames.*最后
TinkerGraph graph = TinkerGraphFactory.createTinkerGraph();
FramedGraphFactory factory = new FramedGraphFactory(new GremlinGroovyModule()); 生产:
groovysh_evaluate: 50: unable to resolve class FramedGraphFactory
@ line 50, column 30.
FramedGraphFactory factory = new FramedGraphFactory(new GremlinGroovyModule()); //(1) Factories should be reused for performance and memory conservation.
^
groovysh_evaluate: 50: unable to resolve class GremlinGroovyModule
@ line 50, column 53。
发布于 2014-04-16 19:09:41
试试这个:
gremlin> Grape.grab([group:"com.tinkerpop",module:"frames",version:"2.4.0"])
==>null
gremlin> graph = TinkerGraphFactory.createTinkerGraph()
==>tinkergraph[vertices:6 edges:6]
gremlin> import com.tinkerpop.frames.*
==>import com.tinkerpop.gremlin.*
==>import com.tinkerpop.gremlin.java.*
==>import com.tinkerpop.gremlin.pipes.filter.*
...
==>import groovy.grape.Grape
==>import com.tinkerpop.frames.*
gremlin> import com.tinkerpop.frames.modules.gremlingroovy.*
==>import com.tinkerpop.gremlin.*
==>import com.tinkerpop.gremlin.java.*
==>import com.tinkerpop.gremlin.pipes.filter.*
==>import com.tinkerpop.gremlin.pipes.sideeffect.*
...
gremlin> factory = new FramedGraphFactory(new GremlinGroovyModule());
==>com.tinkerpop.frames.FramedGraphFactory@645c1312如果您已经复制了jar,那么在开始时省略Grape的使用,但是如果您已经复制了所有的框架依赖项,而不仅仅是框架jar本身(葡萄隐藏了这些东西)。
https://stackoverflow.com/questions/23110331
复制相似问题