【发布时间】:2015-05-18 14:56:24
【问题描述】:
这是我的 rexster.xml 文件,配置如下
<?xml version="1.0" encoding="UTF-8"?>
<rexster>
<http>
<server-port>8182</server-port>
<server-host>0.0.0.0</server-host>
<base-uri>http://localhost</base-uri>
<web-root>public</web-root>
<character-set>UTF-8</character-set>
<enable-jmx>false</enable-jmx>
<enable-doghouse>true</enable-doghouse>
<max-post-size>2097152</max-post-size>
<max-header-size>8192</max-header-size>
<upload-timeout-millis>30000</upload-timeout-millis>
<thread-pool>
<worker>
<core-size>8</core-size>
<max-size>8</max-size>
</worker>
<kernal>
<core-size>4</core-size>
<max-size>4</max-size>
</kernal>
</thread-pool>
<io-strategy>leader-follower</io-strategy>
</http>
<rexpro>
<server-port>8184</server-port>
<server-host>0.0.0.0</server-host>
<session-max-idle>1790000</session-max-idle>
<session-check-interval>3000000</session-check-interval>
<connection-max-idle>180000</connection-max-idle>
<connection-check-interval>3000000</connection-check-interval>
<enable-jmx>false</enable-jmx>
<thread-pool>
<worker>
<core-size>8</core-size>
<max-size>8</max-size>
</worker>
<kernal>
<core-size>4</core-size>
<max-size>4</max-size>
</kernal>
</thread-pool>
<io-strategy>leader-follower</io-strategy>
</rexpro>
<shutdown-port>8183</shutdown-port>
<shutdown-host>127.0.0.1</shutdown-host>
<script-engine-reset-threshold>-1</script-engine-reset-threshold>
<script-engine-init>data/init.groovy</script-engine-init>
<script-engines>gremlin-groovy</script-engines>
<security>
<authentication>
<type>none</type>
<configuration>
<users>
<user>
<username>rexster</username>
<password>rexster</password>
</user>
</users>
</configuration>
</authentication>
</security>
<graphs>
<graph>
<graph-name>ramgraph</graph-name>
<graph-type>tinkergraph</graph-type>
<graph-mock-tx>false</graph-mock-tx>
<properties>
<storage.backend>cassandra</storage.backend>
<storage.hostname>localhost</storage.hostname>
<storage.buffer-size>100</storage.buffer-size>
</properties>
<extensions>
<allows>
<allow>tp:gremlin</allow>
</allows>
</extensions>
</graph>
<graph>
<graph-name>titanexample</graph-name>
<graphtype>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type>
<graph-location>/tmp/titan</graph-location>
<graph-read-only>false</graph-read-only>
<properties>
<storage.backend>local</storage.backend>
<storage.buffer-size>100</storage.buffer-size>
</properties>
<extensions>
<allows>
<allow>tp:gremlin</allow>
</allows>
</extensions>
</graph>
</graphs>
</rexster>
我写了一个带有如下灯泡的python客户端
__author__ = 'rponnapureddy'
from bulbs.config import Config, DEBUG
from bulbs.rexster import Graph
from bulbs.rexster import Graph
# config = Config('http://localhost:8182/graphs/empgraph')
config = Config('http://localhost:8182/graphs/ramgraph')
g = Graph(config)
class inser_class():
ponnapu = g.vertices.create(name="ramnath")
pr = g.vertices.create(name="reddy")
tanu = g.vertices.create(name="brothers")
g.edges.create(pr, "knows", tanu)
# z=g.get_graphml()
#print z
#g.clear()
# print z
我得到以下错误。要正确回答我有什么?
'usr/bin/python2.7 "/home/rpo/Desktop/ramnathreddy/addverices to rexsterdefault graph.py" 回溯(最近一次通话最后): 文件“/home/rpo/Desktop/ramnath/addverices to rexsterdefault graph.py”,第 10 行,在 g = 图表(配置) init 中的文件“/usr/local/lib/python2.7/dist-packages/bulbs/rexster/graph.py”,第 56 行 超级(图形,自我)。初始化(配置) init 中的文件“/usr/local/lib/python2.7/dist-packages/bulbs/base/graph.py”,第 58 行 self.vertices = self.build_proxy(顶点) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/base/graph.py”,第 124 行,在 build_proxy 返回 self.factory.build_element_proxy(element_class, index_class) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/factory.py”,第 19 行,在 build_element_proxy primary_index = self.get_index(element_class,index_class,index_name) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/factory.py”,第 27 行,在 get_index 索引 = index_proxy.get_or_create(index_name) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/rexster/index.py”,第 80 行,在 get_or_create resp = self.client.get_or_create_vertex_index(index_name, index_params) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/rexster/client.py”,第 668 行,在 get_or_create_vertex_index resp = self.gremlin(脚本,参数) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/rexster/client.py”,第 356 行,gremlin return self.request.post(gremlin_path, params) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/rest.py”,第 131 行,在帖子中 return self.request(POST,路径,参数) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/rest.py”,第 186 行,在请求中 返回 self.response_class(http_resp, self.config) init 中的文件“/usr/local/lib/python2.7/dist-packages/bulbs/rexster/client.py”,第 198 行 self.handle_response(响应) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/rexster/client.py”,第 222 行,在 handle_response response_handler(http_resp) server_error 中的文件“/usr/local/lib/python2.7/dist-packages/bulbs/rest.py”,第 50 行 引发系统错误(http_resp) SystemError: ({'status': '500', 'transfer-encoding': 'chunked', 'server': 'grizzly/2.2.16', 'connection': 'close', 'date': 'Mon, 16 2015 年 3 月 11:32:19 GMT', 'access-control-allow-origin': '*', 'content-type': 'application/json'}, '{"message":"","error": “javax.script.ScriptException:groovy.lang.MissingMethodException:没有方法签名:groovy.lang.MissingMethodException.rollback() 适用于参数类型:() 值:[]\n可能的解决方案:collect()、collect(groovy .lang.Closure), collect(java.util.Collection, groovy.lang.Closure)","api":{"description":"为一个图评估一个 ad-hoc Gremlin 脚本。","parameters":{ "rexster.returnKeys":"要返回的元素属性键数组(默认是返回所有元素属性)","rexster.showTypes":"显示元素的属性及其本机数据类型(默认为 false)" ,"load":"在 \'script\' 之前执行的 \'stored procedure\' 列表(如果未指定 \'script\' 则最后一个 scri此参数中的 pt 将返回值","rexster.offset.end":"要返回的分页数据集的结束索引","rexster.offset.start":"要返回的分页数据集的开始索引返回","params":"要绑定到脚本引擎的参数映射","language":"要使用的 gremlin 语言风格(默认为 groovy)","script":"要评估的 Gremlin 脚本"}},"成功":false}')
Process finished with exit code 1'
【问题讨论】:
-
这是您问题中的正确脚本吗?因为第一行已经错了,所以少了一个
':'__author__ = 'rponnapureddy'
标签: python-2.7 titan rexster bulbs