java.lang.StackOverflowError

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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}
    via by Ludovic PRAUD,
  • Crawling error returned non ok status:500
    via by Unknown author,
  • Strange Error
    via GitHub by Nicklander
    ,
  • GitHub comment 7#6225087
    via GitHub by Mtihc
    ,
  • Atualização para versão 3.3.0
    via by Miguel Cartagena,
    • 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)

    Users with the same issue

    Unknown visitor
    Unknown visitor2 times, last one,