[
https://jira.jboss.org/jira/browse/JBSEAM-3268?page=com.atlassian.jira.pl...
]
Shane Bryzak updated JBSEAM-3268:
---------------------------------
Fix Version/s: 2.1.1.CR1
Assignee: Shane Bryzak
Calling AuctionService webservice gives marshalling error
---------------------------------------------------------
Key: JBSEAM-3268
URL:
https://jira.jboss.org/jira/browse/JBSEAM-3268
Project: Seam
Issue Type: Patch
Components: Examples
Affects Versions: 2.0.2.SP1
Environment: WinXP
JBoss 4.2.0.GA
JDK 1.5.0_01
Reporter: Jan Hoeve
Assignee: Shane Bryzak
Fix For: 2.1.1.CR1
Attachments: patch.txt
After deploying the seambay example in Jboss, I encountered the following error while
invoking the webservice AuctionService from soapUI:
[com.sun.istack.SAXException2: A cycle is detected in the object graph. This will cause
infinitely deep XML: org.jboss.seam.example.seambay.Auction@1df2b92 ->
org.jboss.seam.example.seambay.AuctionImage@1d90a6e ->
org.jboss.seam.example.seambay.Auction@1df2b92]
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:295)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:221)
at org.jboss.ws.core.jaxws.JAXBSerializer.serialize(JAXBSerializer.java:83)
After looking at the annotations in Auction and AuctionImage it just is very clear: the
association between the two classes is bidirectional; and thus causing the Marshaller to
throw this error. (Because it cannot find out when to stop following references).
After googling/thinking I added an @XmlTransient annotation to AuctionImage#getAuction
(see patch) , and thus breaking the loop when marshalling.
Now the webserive produces some result and is not giving errors anymore!
The problem-yet-to-solve (curious how you guys would solve): With this XmlTransient,
xml2object unmarshalling is not fully supported anymore (I broke the loop...).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira