Uploaded image for project: 'Apache MetaModel (Retired)'
  1. Apache MetaModel (Retired)
  2. METAMODEL-1182

java.lang.IllegalStateException while creatin Neo4jDataContext

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.0.0
    • None

    Description

      I was trying Apache Metamodel for the first time. I did not find much examples online. So I referred following links:

      Guessed what I should be doing and I wrote first simple code:

      Neo4jDataContext neoData = new  Neo4jDataContext("localhost", 7474, "neo4j", "password");
      System.out.println(neoData.executeQuery("MATCH (n:Logs) RETURN n LIMIT 25"));
      

      But I was getting following exception:

      Exception in thread "main" java.lang.IllegalStateException: org.json.JSONException: A JSONArray text must start with '[' at character 0
      at org.apache.metamodel.neo4j.Neo4jDataContext.getAllNodesPerLabel(Neo4jDataContext.java:277)
      at org.apache.metamodel.neo4j.Neo4jDataContext.detectTableDefs(Neo4jDataContext.java:171)
      at org.apache.metamodel.neo4j.Neo4jDataContext.<init>(Neo4jDataContext.java:97)
      at com.digitate.ignio.ApacheMetamodelExp.ApacheMetamodelPoc.main(ApacheMetamodelPoc.java:14)
      Caused by: org.json.JSONException: A JSONArray text must start with '[' at character 0
      at org.json.JSONTokener.syntaxError(JSONTokener.java:410)
      at org.json.JSONArray.<init>(JSONArray.java:113)
      at org.json.JSONArray.<init>(JSONArray.java:157)
      at org.apache.metamodel.neo4j.Neo4jDataContext.getAllNodesPerLabel(Neo4jDataContext.java:269)
      ... 3 more
      

      Am I correct with the two line code? I mean is it supposed to work? I debugged in eclipse. I realized that inside Neo4jDataContext() constructor, call to detectTableDefs() is made. Inside detectTableDefs(), the labelsJsonArray is getting populated correctly on line 163. But for some random label, getAllNodesPerLabel() called on line 171 throws above exception. By "some random label" , I mean that for some labels, getAllNodesPerLabel() executes successfully on line 171, but suddenly it fails for some labels. I am unable to pin point for which labels / which characteristics of labels exception is occurring.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            Mahesha999 Mahesh Abnave
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: