Bug 476681 - StackOverflowError with Recursive @XmlSeeAlso
Summary: StackOverflowError with Recursive @XmlSeeAlso
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-04 19:10 EDT by Kenneth Gendron CLA
Modified: 2022-06-09 10:09 EDT (History)
0 users

See Also:


Attachments
Contains Root, Sub, and SubSub that shows the failure when run with eclipselink.jar (1.08 KB, application/x-zip-compressed)
2015-09-04 19:10 EDT, Kenneth Gendron CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Gendron CLA 2015-09-04 19:10:16 EDT
Created attachment 256397 [details]
Contains Root, Sub, and SubSub that shows the failure when run with eclipselink.jar

If @XmlSeeAlso is used recursively a StackOverflowError will be thrown when a new JAXBContext is created.

Example:

@XmlRootElement(name="root")
@XmlSeeAlso(Sub.class)
public class Root {}

@XmlType(name="sub")
@XmlSeeAlso(SubSub.class)
public class Sub {}

@XmlType(name="subsub")
@XmlSeeAlso(Sub.class)
public class SubSub {}

When JAXBContext.newInstance(Root.class) is called, the StackOverflowError will be called because it does not detect the recursive reference from SubSub to Sub.  The reference implementation of JAXB does detect this and ignores the recursive reference.

Thanks,

Ken
Comment 1 Eclipse Webmaster CLA 2022-06-09 10:09:27 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink