1

I'm getting a StackOverFlow exception when trying to save my JGraphX model as XML, because I have a circular reference on my mxCell value class (and yes, I need it).

My question is: How can I make the JGraphX recognize the attribute responsible for the loop as a reference, or make it transient in some way, so I can save and read the XML later without problems?

  • For any kind of circular reference (i'm assuming you mean recursion), you need a base condition at which it would break out of it. Do you have one? Also, some code would be helpful... – LazyCubicleMonkey Oct 10 '13 at 02:13
  • No, I mean a bidirectional relation. For example, I have a parent class with a List filled with his children, and each child has an attribute referring to its parent. So when JGraphX try to map it to XML, it enters on an infinite loop. Therefore, I need a way to make JGraphX know that the parent object on the child was already mapped, making an reference to it, or simply ignoring the attribute. – Israel Sant'Anna Oct 11 '13 at 23:50

0 Answers0