File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Circular reference detected while serializing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Circular reference detected while serializing" Watch "Circular reference detected while serializing" New topic
Author

Circular reference detected while serializing

Rahul Juneja
Ranch Hand

Joined: Aug 03, 2002
Posts: 425
I have been trying hard to get this resolved this, but haven't reached to any conclusion.

Here is my situation.
I have two entities called Parent and Child, where parent has a refernce to many child and child has one parent so inturn there is OneToMany(Bidirectional) relationship between them. When i expose this as a webservice I get the following exception :

<faultstring>Internal Server Error (circular reference detected while serializing: com.thoughtclicks.Parent)</faultstring>

This error occurs incase i expose the service as Document/Literal, incase i expose this service as RPC Encoded then this exception doesn�t occurs and everything is fine, but Axis2 doesn;t support client generation for RPC/Encoded so again a problem.

Also, I have already tried putting @XMLTransient annotation on getChild() of the Parent class, but it doesn�t help and i continue getting the same error.

Let me know if there is a work around for this solution.

Any pointers are highly appreciated.

Thanks,
Rahul


Rahul Juneja
ThoughtClicks - http://techlabs.thoughtclicks.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Circular reference detected while serializing
 
Similar Threads
Spring Application Context in Maven multi-module project
(Hibernate operation: could not insert:
Circular IDs and IDREFS.....need help!
Apache XML-RPC jar causing conflict with some GWT jar
raw xml as the payload