2015-03-16 2 views
-4

Это мой файл 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> 

и я написал клиент питона с лампочками вроде как ниже

__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/бен/python2.7 "/ главная/RPO/Desktop/ramnathreddy/addverices к rexsterdefault graph.py" Traceback (самый последний вызов последнего): Файл«/ главная/RPO/Desktop/ramnath/addverices to rexsterdefault graph.py ", строка 10, в g = График (config) Файл" /usr/local/lib/python2.7/dist-packages/bulbs/rexster/graph.py ", строка 56, в инициатор super (Graph, self). инициализации (конфигурации) Файл "/usr/local/lib/python2.7/dist-packages/bulbs/base/graph.py", строка 58, в инициализации self.vertices = self.build_proxy (Vertex) Файл «/usr/local/lib/python2.7/dist-packages/bulbs/base/graph.py», строка 124, в build_proxy return 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 = 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 (script, params) Файл"/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, path, params) Файл" /usr/local/lib/python2.7/dist-packages/bulbs/rest.py ", строка 186, по запросу return self.response_class (http_res р, self.config) Файл "/usr/local/lib/python2.7/dist- пакеты/луковицы/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) Файл" /usr/local/lib/python2.7/dist- пакеты/луковицы/rest.py ", строка 50, в server_error raise SystemError (http_resp) SystemError: ({'status': '500', 'transfer-encoding': 'chunked', 'server': 'grizzly/2.2.16 ',' connection ':' close ',' date ':' Mon, 16 Mar 2015 11:32:19 GMT ',' access-control-allow-origin ':' * ',' content-type ' : 'application/json'}, '{"message": "", "error": "javax.script.ScriptException: groovy.lang.MissingMethodException: No signat ure метода: groovy.lang.MissingMethodException.rollback() применим для типов аргументов:() values: [] \ nВозвращаемые решения: collect(), collect (groovy.lang.Closure), collect (java.util.Collection, groovy.lang.Closure) "," api ": {" description ":" оценить ad-hoc скрипт Гремлина для графика. "," parameters ": {" rexster.returnKeys ":" массив ключей свойств элемента к return (по умолчанию - вернуть все свойства элемента) "," rexster.showTypes ":" отображает свойства элементов с их собственным типом данных (по умолчанию - false) "," load ":" список хранимых процедур \ "для выполнения до \ 'script \' (если \ script \ 'не указан, тогда последний скрипт в этом аргументе вернет значения "," rexster.offset.end ":" end index для выгружаемого набора данных, которые будут возвращены "," rexster.offset.start ":" начальный индекс для выгружаемого набора данных для возврата »,« params »:« карта параметров для привязки к движку сценария »,« язык »:« вкус языка гремлина для использования (по умолчанию для groovy) »,« script «:» сценарий Gremlin быть оценен «}},» успех ": ложь} ')

Process finished with exit code 1' 
+1

это правильный сценарий в вашем вопросе Поскольку первая линия уже не так, есть? '' 'missing:' '__a uthor__ = 'rponnapureddy'' –

ответ

0
from bulbs.config import Config, DEBUG 
from bulbs.rexster import Graph 
from bulbs.titan import Graph 

config = Config('http://localhost:8182/graphs/ramgraph') 
g = Graph(config) 


class inser_class(): 
    ponnapu = g.vertices.create(name="reddy", age="26", state="TELNGANA", mobn="111111111") 
    pr = g.vertices.create(name="ramnath" ,age="25" , state="TELNGANA", mobn="1111111") 
    tanu = g.vertices.create (name="ponnapu",age="27",state="AP",mobn="11111111111111") 
    g.edges.create(pr, "knows", tanu) 
    g.edges.create(pr, "friends", ponnapu) 
    g.edges.create(ponnapu, "dontknow",tanu)