【问题标题】:Configure Rexster to use Titan配置 Rexster 以使用 Titan
【发布时间】:2014-09-15 09:27:59
【问题描述】:

我正在尝试通过修改 Rexster 中的 rexster.xml 文件来配置 Rexster 以使用 Titan。 但是当我运行时

  http ://localhost:8182/graphs/mygraph 

在我的浏览器中,我收到一条消息:

{"message":"找不到图 [mygraph]"}.

这是我修改的 rexster.xml 文件的一部分:

    <graph>
    <graph-name>mygraph</graph-name>
    <graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type>
        <graph-location>C:/titan-server-jre6-0.4.4/bin/mygraph</graph-location>
          <graph-read-only>false</graph-read-only>
              <properties>
                    <storage.backend>local</storage.backend>
                    <buffer-size>100</buffer-size>
              </properties>
              <extensions>
                <allows>
                  <allow>tp:gremlin</allow>
                </allows>
              </extensions>
    </graph>

我已将 Titans lib 文件夹中的所有 jar 文件添加到 config/ext/titan 下的 Rexster 中,并使用 gremlin shell i Titan 在 Titan 中创建了一个图形:

    g = TitanFactory.open('mygraph');
    g.createKeyIndex('name', Vertex.class);
    v = g.addVertex(null);
    v.setProperty('name','x');
    v.setProperty('type','person');
    v.setProperty('age',20);
    v1 = g.addVertex(null);
    v1.setProperty('name','y');

    v1.setProperty('type','person');

    v1.setProperty('age',22);
    e = g.addEdge(null, v, v1, 'knows');
    e1 = g.addEdge(null, v1, v, 'knows');
    g.shutdown();

我错过了什么?

[更新]:

我将 Titan 中的 jar 文件放在了 rexster 的错误目录中,现在它们在 rexster 中的正确位置。但是当我现在运行 rexster 服务器时,我得到以下输出:

    [INFO] Application - .:Welcome to Rexster:.
    [INFO] RexsterProperties - Using [C:\rexster-server-2.5.0\config\rexster.xml] as
    configuration source. 
    [INFO] Application - Rexster is watching [C:\rexster-server-2.5.0\config\rexster
    .xml] for change.
    Exception in thread "main" java.lang.AbstractMethodError: com.thinkaurelius.tita 
    n.tinkerpop.rexster.TitanGraphConfiguration.configureGraphInstance(Lcom/tinkerpo
    p/rexster/config/GraphConfigurationContext;)Lcom/tinkerpop/blueprints/Graph;
    at com.tinkerpop.rexster.config.GraphConfigurationContainer.getGraphFrom
    Configuration(GraphConfigurationContainer.java:124)
    at com.tinkerpop.rexster.config.GraphConfigurationContainer.<init>(Graph 
    ConfigurationContainer.java:54)
    at com.tinkerpop.rexster.server.XmlRexsterApplication.reconfigure(XmlRex
    sterApplication.java:99)
    at com.tinkerpop.rexster.server.XmlRexsterApplication.<init>(XmlRexsterA
    pplication.java:47)
    at com.tinkerpop.rexster.Application.<init>(Application.java:97)
    at com.tinkerpop.rexster.Application.main(Application.java:189)

我该如何解决这个问题?

【问题讨论】:

  • 启动 Rexster Server 时控制台的输出是什么?它列出了所有已配置的图表,并应显示有关该特定图表未配置的信息。
  • 之前没有查看输出,但它显示 [WARN] GraphConfigurationContainer - Can npt load graph mygraph.请检查xml配置。这似乎是由于 Rexster 找不到类 com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration 造成的。我该如何解决这个问题?
  • 我假设您在 Windows 上运行并使用 rexster.bat?
  • 是的,我也更新了我的问题,注意到我在 Rexster 中将 jar 文件放在了错误的位置,但现在出现了一个新错误。
  • 您使用的是什么版本的 Titan?

标签: titan rexster


【解决方案1】:

在我使用 2.5.0 版本之前,通过更改 rexster 服务器的版本解决了问题。我现在使用的是 Titan 2.4.0 和 0.4.4 版。

【讨论】:

    猜你喜欢
    • 2015-02-15
    • 2014-07-10
    • 2014-11-27
    • 2014-06-10
    • 2013-11-03
    • 2023-03-27
    • 2013-09-02
    • 2016-03-26
    • 2014-06-27
    相关资源
    最近更新 更多