Getting JSON from Jersey with circular dependencies
问题 I am writing a service that uses Jersey and JAXB. My classes are annotated with @XMLRootElement, @XMLElement, etc. I have a circular dependency between two classes, so I have annotated the circular dependent property with @XMLTransient. So when I call my service I get xml as the default, which works perfectly. However, when I try using JSON, I get repeated lines like: {"name":"dere","entries":[{"points":0,"wins":0,"losses":0,"ties":0,"leaderboard":{"name":"dere","entries":[{"points":0,"wins"