Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3627156
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:51:09+00:00 2026-05-18T23:51:09+00:00

I have a issue where, I have a converter class say called aConverter as

  • 0

I have a issue where, I have a converter class say called aConverter as such:

@XmlRootElement(name = "aConverter")
public class aConverter implements ConverterBase{

      private A a;
      private Set<B> bs;
      /// some constructor code here
      ...
      @XmlElement(name="B")
      public Set<B> getBs() {
                bs = a.getBs();
                return bs;
      }

      public void setBs(Set<B> bs) {
                a.setBs(bs);
      }
}

Class A and B are defined respectively in a cyclic fashion:

public class A {
       private Set <B> bs;

       //constructor code here
       ... 

       public Set<B> getBs() {
          return this.bs;
       }
       public void setBs(Set<B> bs) {
          this.bs = bs;
       }
}

>

public class B {
       private A a;

       // some constructor code here
       ...

       public A getA() {
              return this.a;
       }
       public void setA(A a) {
              this.a = a;
       }
}

Now, when I the webservice I’m seeing the following error:

[com.sun.istack.internal.SAXException2: A cycle is detected in the object graph. This will cause infinitely deep XML: B@1105452 -> A@1 -> B@1105452]
at com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider.writeTo(AbstractRootElementProvider.java:152)
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:294)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1140)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1053)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1043)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:406)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:477)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:662)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:680)
Caused by: javax.xml.bind.MarshalException
– with linked exception:

I’m really out of ideas here, any feeback on this would be really nice.

Cheers!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T23:51:10+00:00Added an answer on May 18, 2026 at 11:51 pm

    In EclipseLink JAXB (MOXy) we introduced the @XmlInverseReference extension to solve this issue. For an example of how this can be leveraged in a JAX-RS service check out:

    • http://bdoughan.blogspot.com/2010/08/creating-restful-web-service-part-35.html
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an issue while getting the file name with out extension from a
I have a random question about const correctness. Lets say i have a class
I have a class with a std::function constructor parameter. class ClazzA{ public: ClazzA(function<void()> foo){}
I have a class like this: //Array of Structures class Unit { public: float
Say I have an object called data which contains a variety of information. Let's
Share your ideas please! I have issue to check the folder and convert a
I have issue with: <form:checkboxes path=roles cssClass=checkbox items=${roleSelections} /> If previous line is used
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
We are new to ROR, We have issue in creating Login/Logout process in ROR
Have an issue with marshall and unmarshall readers and writers. So here it is.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.