<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: ivy.repo.save recursive Error</title><link>https://answers.axonivy.com/questions/4550/ivy-repo-save-recursive-error</link><description>&lt;p&gt;Hi Comunity,&lt;/p&gt;
&lt;p&gt;When i use the ivy.repo.save to save my business data. I got an error as below:&lt;/p&gt;
&lt;p&gt;java.lang.StackOverflowError
    JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: java.util.ArrayList[0]-&amp;gt;ch.ivyteam.ivy.security.internal.Role["users"]-&amp;gt;ch.ivyteam.ivy.persistence.client.PersistentClientObjectList[0]-&amp;gt;ch.ivyteam.ivy.security.internal.User["allRoles"]-&amp;gt;.....&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;IvyRuntimeException: com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: java.util.ArrayList[0]-&amp;gt;ch.ivyteam.ivy.security.internal.Role["users"]-&amp;gt;ch.ivyteam.ivy.persistence.client.PersistentClientObjectList[0]-&amp;gt;ch.ivyteam.ivy.security.internal.User["allRoles"].....

IvyScriptMethodInvocationException: Error calling method save(Object) on an object of class ch.ivyteam.ivy.business.data.store.internal.BusinessDataRepositoryImpl.

IvyScriptRuntimeException: IvyScript Runtime Exception in
    Instruction:
        ivy.repo.save(in.groundwaterProtectionZones)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Could any one help me to explain why it happen and how to solve it?
Thanks&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/4550/ivy-repo-save-recursive-error" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 04 May 2020 13:46:29 -0400</lastBuildDate><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/4550/ivy-repo-save-recursive-error/4554</link><description>&lt;p&gt;You are trying to persist a collection of ivy-core user objects. And these are long recursive trees. Which even lead to a stack overflow if you try to serialize them.&lt;/p&gt;
&lt;p&gt;However, normally this happens by an accident when designing your Data. And I'd simply remove that object from the object tree before serializing. I didn't test it but think that either by removing 'persist' flags on the DataClass or if you are persisting a normal java object, just mark the field and it's getters with &lt;code&gt;@JsonIgnore&lt;/code&gt;. See &lt;a href="https://dev.axonivy.com/doc/8.0/designer-guide/data-modeling/business-data.html#field-without-get-setter"&gt;https://dev.axonivy.com/doc/8.0/designer-guide/data-modeling/business-data.html#field-without-get-setter&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Mon, 04 May 2020 13:46:29 -0400</pubDate><guid>https://answers.axonivy.com/questions/4550/ivy-repo-save-recursive-error/4554</guid></item></channel></rss>