Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328721 - JAXB: Issues with XmlElementRefs and non-global scope
Summary: JAXB: Issues with XmlElementRefs and non-global scope
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Matt MacIvor CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-26 10:20 EDT by David McCann CLA
Modified: 2022-06-09 10:07 EDT (History)
3 users (show)

See Also:


Attachments
Test Case demonstrating bug (9.18 KB, patch)
2011-05-24 11:54 EDT, Rick Barkhouse CLA
no flags Details | Diff
proposed fix and test (40.07 KB, patch)
2011-09-19 12:49 EDT, Matt MacIvor CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David McCann CLA 2010-10-26 10:20:42 EDT
When an XmlElementRef is used with mixed or an XmlAnyElement, and the refs have a non-global scope, an exception like the following will occur:

------------------------------------------------------------
javax.xml.bind.JAXBException: 
Exception Description: Invalid XmlElementRef on property others on class org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.xmlelementrefs.FooImplNoAnnotations. Referenced Element not declared
------------------------------------------------------------

This is because in both cases we create an XMLAnyCollection mapping which will handle references for things that have default root elements, but non-global elements don't count as default roots.
Comment 1 Rick Barkhouse CLA 2011-05-24 11:54:23 EDT
Created attachment 196457 [details]
Test Case demonstrating bug
Comment 2 Matt MacIvor CLA 2011-09-19 12:49:20 EDT
Created attachment 203615 [details]
proposed fix and test
Comment 3 Matt MacIvor CLA 2011-09-21 10:09:09 EDT
Attached fix checked into 2.3.1 and trunk
Reviewed by Blaise Doughan
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:07:31 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink