JAXWS Scaffolded load operation with parent child DOs issue

  1. MyEclipse IDE > Spring Development

This topic contains 0 replies, has 1 voice, and was last updated by  davemeurer 10 years, 5 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #306356 Reply

    davemeurer
    Member

    Hi All,

    I wanted to report an issue that was raised to our attention. When enabling JAXWS Spring Services thru MyEclipse for Spring that contain references to domain objects that have relationships, you may get a Marshalling Error when executing the load operation.

    The full error is: org.apache.cxf.interceptor.Fault: Marshalling Error: A cycle is detected in the object graph. This will cause infinitely deep XML

    I found this article that explains how to resolve it:

    https://jaxb.dev.java.net/guide/Mapping_cyclic_references_to_XML.html

    In my app (same as webinar app), I added the @XMLTransient to the parent attribute in the child pojo, and removed its @XMLElement. So, the resulting attribute looks like:

    @ManyToOne(cascade = { CascadeType.ALL, CascadeType.REMOVE }, fetch = FetchType.LAZY)
        @JoinColumns( { @JoinColumn(name = "PRODUCTCODE", referencedColumnName = "PRODUCTCODE") })
        @XmlTransient
        Product product;

    I then added the @XMLRootElement to my Product class declaration.

    Reply to this post if you have any questions.
    Dave

Viewing 1 post (of 1 total)
Reply To: JAXWS Scaffolded load operation with parent child DOs issue

You must be logged in to post in the forum log in