Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328721

Summary: JAXB: Issues with XmlElementRefs and non-global scope
Product: z_Archived Reporter: David McCann <david.mccann>
Component: EclipselinkAssignee: Matt MacIvor <matt.macivor>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: blaise.doughan, david.twelves, matt.macivor
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Test Case demonstrating bug
none
proposed fix and test none

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