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