【问题标题】:Deploying the GraphAware friendship-counter example to some standalone neo4j server将 GraphAware 友谊计数器示例部署到一些独立的 neo4j 服务器
【发布时间】:2017-02-09 05:27:00
【问题描述】:

我正在尝试使用 GraphAware 的示例来了解它是如何工作的。但我无法运行他们的friendship counter example

为此,我使用mvn package 构建了上述示例包,它生成了以下 jar 文件:

  • friendship-strength-counter-module-3.1.0.45-SNAPSHOT.jar
  • friendship-strength-counter-module-3.1.0.45-SNAPSHOT-javadoc.jar
  • friendship-strength-counter-module-3.1.0.45-SNAPSHOT-sources.jar
  • graphaware-friendship-strength-counter-module-3.1.0.45-SNAPSHOT.jar

然后我将第一个文件与 GraphAware framework-server-community 的 latest version 一起复制到 neo4j 的 plugins 目录中。然后我将以下行添加到neo4j.conf 文件中:

dbms.unmanaged_extension_classes=com.graphaware.server=/graphaware

并重新启动 neo4j 服务器。当我转到 http://localhost:7474/graphaware/friendship/strength 时,我可以看到代码的 REST API 部分正在工作,因为它返回 0 并且它还在服务器上创建了一个 :FriendshipCounter 节点。

但似乎FriendshipStrengthCounter 类没有注册为TransactionEventHandler,因为当我创建以下两个节点时:

CREATE (n)-[:FRIEND_OF{strength: 2}]->(m);

计数器未更新。有人可以告诉我我在哪里犯了错误吗?谢谢。

【问题讨论】:

    标签: java maven neo4j graphaware


    【解决方案1】:

    您能否尝试通过将这些行添加到您的 neo4j.conf 来启用框架和模块:

    com.graphaware.runtime.enabled=true
    
    #COUNTER becomes the module ID:
    com.graphaware.module.COUNTER.1=com.graphaware.example.module.FriendshipStrengthModuleBootstrapper
    

    【讨论】:

    • 谢谢它的工作,但您能否提供一些关于这些是什么以及如何使用它们的参考或文档?例如,.1 部分是什么?
    • 是的,框架文档中解释了 .1 部分。但我们会在反例中添加一些文档
    最近更新 更多