如何使用neo4j 2.1.5连接灯泡。我遵循了以下步骤,但它没有帮助。
下载并解压缩neo4j 2.1.5。
下载并解压缩neo4j gremlin插件2.1.5。
将所有来自gremlin插件的jar复制到$ NEO4J_HOME / plugins / gremlin-plugin
修改了neo4j-server.properties以添加:
org.neo4j.server.thirdparty_jaxrs_classes=com.thinkaurelius.neo4j.plugins=/tp
重启neo4j
bin/neo4j start
扩展程序未显示
root@scspn0018050001:~# curl localhost:7474/db/data/
{
"extensions" : {
},
"node" : "http://localhost:7474/db/data/node",
"node_index" : "http://localhost:7474/db/data/index/node",
"relationship_index" : "http://localhost:7474/db/data/index/relationship",
"extensions_info" : "http://localhost:7474/db/data/ext",
"relationship_types" : "http://localhost:7474/db/data/relationship/types",
"batch" : "http://localhost:7474/db/data/batch",
"cypher" : "http://localhost:7474/db/data/cypher",
"indexes" : "http://localhost:7474/db/data/schema/index",
"constraints" : "http://localhost:7474/db/data/schema/constraint",
"transaction" : "http://localhost:7474/db/data/transaction",
"node_labels" : "http://localhost:7474/db/data/labels",
"neo4j_version" : "2.1.5"
}
但是执行得很好
root@scspn0018050001:~# curl http://localhost:7474/tp/gremlin/execute
{"success":true}
现在,这就是我的灯泡脚本的样子:
from bulbs.neo4jserver import Graph,Config, NEO4J_URI
config = Config('http://localhost:7474/db/data')
graph = Graph(config)
james = graph.vertices.create(name="James")
但是,在执行灯泡脚本
root@scspn0018050001:~/neuro/src# python bulbsTest.py
Traceback (most recent call last):
File "bulbsTest.py", line 4, in <module>
james = graph.vertices.create(name="James")
File "/usr/local/lib/python2.7/dist-packages/bulbs/element.py", line 565, in create
resp = self.client.create_vertex(data, keys=_keys)
File "/usr/local/lib/python2.7/dist-packages/bulbs/neo4jserver/client.py", line 424, in create_vertex
return self.create_indexed_vertex(data, index_name, keys=keys)
File "/usr/local/lib/python2.7/dist-packages/bulbs/neo4jserver/client.py", line 1054, in create_indexed_vertex
return self.gremlin(script,params)
File "/usr/local/lib/python2.7/dist-packages/bulbs/neo4jserver/client.py", line 384, in gremlin
return self.request.post(path, params)
File "/usr/local/lib/python2.7/dist-packages/bulbs/rest.py", line 131, in post
return self.request(POST, path, params)
File "/usr/local/lib/python2.7/dist-packages/bulbs/rest.py", line 186, in request
return self.response_class(http_resp, self.config)
File "/usr/local/lib/python2.7/dist-packages/bulbs/neo4jserver/client.py", line 217, in __init__
self.handle_response(response)
File "/usr/local/lib/python2.7/dist-packages/bulbs/neo4jserver/client.py", line 249, in handle_response
response_handler(response)
File "/usr/local/lib/python2.7/dist-packages/bulbs/rest.py", line 39, in not_found
raise LookupError(http_resp)
LookupError: ({'status': '404', 'access-control-allow-origin': '*', 'content-type': 'application/json; charset=UTF-8', 'content-length': '752', 'server': 'Jetty(9.0.5.v20130815)'}, '{\n "message" : "No such ServerPlugin: \\"GremlinPlugin\\"",\n "exception" : "PluginLookupException",\n "fullname" : "org.neo4j.server.plugins.PluginLookupException",\n "stacktrace" : [ "org.neo4j.server.plugins.PluginManager.extension(PluginManager.java:115)", "org.neo4j.server.plugins.PluginManager.invoke(PluginManager.java:156)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:312)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:134)", "java.lang.reflect.Method.invoke(Method.java:606)", "org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)", "java.lang.Thread.run(Thread.java:744)" ]\n}')
感谢任何帮助。