通过 python-joern 访问 neo4j

Access neo4j via python-joern

使用 Joern 时,我使用以下代码通过 python-joern 访问了 Neo4j 数据库。

from joern.all import JoernSteps
j = JoernSteps()
j.setGraphDbURL('http://localhost:7474/db/data/')
j.connectToDatabase()
res =  j.runGremlinQuery('getFunctionsByName("main")')
for r in res: print r

这样的错误

Traceback (most recent call last):
  File "test.py", line 11, in <module>
    res =  j.runGremlinQuery('getFunctionsByName("main")')
  File "/home/binbin/Downloads/python-joern-0.3.1/joern/all.py", line 44, in runGremlinQuery
    return self.gremlin.execute(finalQuery)
  File "/usr/local/lib/python2.7/dist-packages/py2neo-2.0-py2.7-linux-x86_64.egg/py2neo/ext/gremlin/__init__.py", line 36, in execute
    response = self.resources["execute_script"].post({"script": script})
  File "/usr/local/lib/python2.7/dist-packages/py2neo-2.0-py2.7-linux-x86_64.egg/py2neo/core.py", line 288, in post
    raise_from(self.error_class(message, **content), error)
  File "/usr/local/lib/python2.7/dist-packages/py2neo-2.0-py2.7-linux-x86_64.egg/py2neo/util.py", line 215, in raise_from
    raise exception
py2neo.error.NoClassDefFoundError: javax/transaction/SystemException

如何解决?

我搜索了很多我的问题。最后我在这里找到了解决方案:https://github.com/fabsx00/python-joern/issues/14。遇到同样问题的朋友可以看看