MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
davemeurer
Post subject: JAXWS Scaffolded load operation with parent child DOs issue  PostPosted: Feb 25, 2010 - 04:52 PM



Joined: Jan 20, 2010
Posts: 191

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:

Code:
@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
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits