how did you fix the circular reference

1 view
Skip to first unread message

Jay

unread,
Nov 25, 2025, 7:13:10 PM (3 days ago) Nov 25
to kryo-users
javax.persistence.PersistenceException: org.hibernate.cache.CacheException: com.esotericsoftware.kryo.KryoException: A StackOverflow occurred. The most likely cause is that your data has a circular reference resulting in infinite recursion. Try enabling references with Kryo.setReferences(true). If your data structure is really more than 3845 levels deep then try increasing your Java stack size.I am using redisson 3.36.0 and I have set the Kyro references to true . But still having issue. How did you fix it. 
if (kryo != null && kryo.javaClass.simpleName == "Kryo") {
            val setReferencesMethod = kryo.javaClass.getMethod("setReferences", Boolean::class.javaPrimitiveType)
            setReferencesMethod.invoke(kryo, true)
            logger.info("Successfully called kryo.setReferences(true) on pool instance via $methodName")
           

Reply all
Reply to author
Forward
0 new messages