Java 安装Neo4j REST服务器插件
我正在尝试基于以下内容为Neo4j REST服务器创建示例服务器插件 我用Java 安装Neo4j REST服务器插件,java,rest,plugins,amazon-ec2,neo4j,Java,Rest,Plugins,Amazon Ec2,Neo4j,我正在尝试基于以下内容为Neo4j REST服务器创建示例服务器插件 我用neo4j1.7.2ceubuntu12.0464位(ami-f3c8679a)安装了amazonec2实例,它工作正常-我在尝试获取MyEC2DNS:7474/db/data时得到了正确的响应,所以服务器正常 日蚀 创建新的Java项目 创建libs文件夹,并从下载的1.7.2 Neo4j社区版-Neo4j-Community-1.7.2/lib复制所有文件,并将其添加到构建路径 在package com.neo4j.
neo4j1.7.2ceubuntu12.0464位(ami-f3c8679a)
安装了amazonec2实例,它工作正常-我在尝试获取MyEC2DNS:7474/db/data
时得到了正确的响应,所以服务器正常
日蚀
- 创建新的Java项目
- 创建
文件夹,并从下载的libs
-1.7.2 Neo4j社区版
复制所有文件,并将其添加到构建路径Neo4j-Community-1.7.2/lib
- 在
中创建了包含内容的示例类package com.neo4j.server.plugins.example
MyEC2DNS:7474/db/data
时,扩展仍然不可见
想法?我的猜测是,这个插件可能太大了(不需要包含所有这些.jar,但另一种方法是什么——如何将它们放在相对路径中?)。解决了,除了
定位在Java项目文件夹中并执行jar-cvf get_all.jar*-我得到了~13Mb.jar文件
应该是哪一个
-在Eclipse中转到File-Export-JAR-导出除“lib”文件夹之外的所有内容
然后它工作得很好,当然插件本身只有~100KB。为了验证,您是否尝试过将neo4j-server-examples.jar放入plugins文件夹并使其工作?
@Description("An extension to the Neo4j Server for getting all nodes or relationships")
public class GetAll extends ServerPlugin {
@Name("get_all_nodes")
@Description("Get all nodes from the Neo4j graph database")
@PluginTarget( GraphDatabaseService.class)
public Iterable<Node> getAllNodes(@Source GraphDatabaseService graphDb) {
return GlobalGraphOperations.at(graphDb).getAllNodes();
}
@Description("Get all relationships from the Neo4j graph database")
@PluginTarget(GraphDatabaseService.class)
public Iterable<Relationship> getAllRelationships(@Source GraphDatabaseService graphDb) {
return GlobalGraphOperations.at(graphDb).getAllRelationships();
}
}
Stopping Neo4j server [1718].... done
./bin/neo4j: line 174: ulimit: open files: cannot modify limit: Operation not permitted
Starting Neo4j Server...WARNING: not chaning user
process [1891]... waiting for server to be ready...... OK