java.lang.StackOverflowError

JIRA | Ludovic PRAUD | 4 years ago
  1. 0

    I first created an issue at spring-data-mongo https://jira.springsource.org/browse/DATAMONGO-488 and it appears that the issue come from the mongo Java Driver. Following my test code : {code} Mongo mongo = new Mongo("localhost" , 27017); DB db = mongo.getDB("test"); DBCollection sites = db.getCollection("sites"); DBCollection users = db.getCollection("users"); BasicDBObject site = new BasicDBObject(); ObjectId siteId = new ObjectId(); site.put("_id", site); site.put("name", "site"); WriteResult result = sites.insert(site); BasicDBObject user = new BasicDBObject(); ObjectId userId = new ObjectId(); user.put("_id", userId); user.put("name", "user"); user.put("site", new DBRef(db, site)); // throws a StackoverflowError {code} Is this a proper use of DBRef or does cycle reference not allowed ? The incriminated stacktrace : {code} java.lang.StackOverflowError at java.util.LinkedHashMap$LinkedHashIterator.<init>(LinkedHashMap.java:362) at java.util.LinkedHashMap$LinkedHashIterator.<init>(LinkedHashMap.java:362) at java.util.LinkedHashMap$KeyIterator.<init>(LinkedHashMap.java:400) at java.util.LinkedHashMap$KeyIterator.<init>(LinkedHashMap.java:400) at java.util.LinkedHashMap.newKeyIterator(LinkedHashMap.java:413) at java.util.HashMap$KeySet.iterator(HashMap.java:887) at com.mongodb.DBCollection._checkKeys(DBCollection.java:1170) at com.mongodb.DBCollection._checkKeys(DBCollection.java:1174) at com.mongodb.DBCollection._checkKeys(DBCollection.java:1174) at com.mongodb.DBCollection._checkKeys(DBCollection.java:1174) at com.mongodb.DBCollection._checkKeys(DBCollection.java:1174) at com.mongodb.DBCollection._checkKeys(DBCollection.java:1174) at com.mongodb.DBCollection._checkKeys(DBCollection.java:1174) ... {code}

    JIRA | 4 years ago | Ludovic PRAUD
    java.lang.StackOverflowError
  2. 0

    Crawling error returned non ok status:500

    Google Groups | 9 months ago | Unknown author
    java.lang.StackOverflowError
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Strange Error

    GitHub | 4 years ago | Nicklander
    java.lang.StackOverflowError
  5. 0

    GitHub comment 7#6225087

    GitHub | 4 years ago | Mtihc
    java.lang.StackOverflowError

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.StackOverflowError

      No message provided

      at java.util.LinkedHashMap$LinkedHashIterator.<init>()
    2. Java RT
      HashMap$KeySet.iterator
      1. java.util.LinkedHashMap$LinkedHashIterator.<init>(LinkedHashMap.java:362)
      2. java.util.LinkedHashMap$LinkedHashIterator.<init>(LinkedHashMap.java:362)
      3. java.util.LinkedHashMap$KeyIterator.<init>(LinkedHashMap.java:400)
      4. java.util.LinkedHashMap$KeyIterator.<init>(LinkedHashMap.java:400)
      5. java.util.LinkedHashMap.newKeyIterator(LinkedHashMap.java:413)
      6. java.util.HashMap$KeySet.iterator(HashMap.java:887)
      6 frames
    3. MongoDB Java Driver
      DBCollection._checkKeys
      1. com.mongodb.DBCollection._checkKeys(DBCollection.java:1170)
      2. com.mongodb.DBCollection._checkKeys(DBCollection.java:1174)
      3. com.mongodb.DBCollection._checkKeys(DBCollection.java:1174)
      4. com.mongodb.DBCollection._checkKeys(DBCollection.java:1174)
      5. com.mongodb.DBCollection._checkKeys(DBCollection.java:1174)
      6. com.mongodb.DBCollection._checkKeys(DBCollection.java:1174)
      7. com.mongodb.DBCollection._checkKeys(DBCollection.java:1174)
      7 frames