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

Bug 328283

Summary: MOXy: Exception occurs with XmlElementRef(s) and XmlMixed on non-colleciton/map property
Product: z_Archived Reporter: David McCann <david.mccann>
Component: EclipselinkAssignee: Matt MacIvor <matt.macivor>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david.twelves, eclipselink.oxm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed Fix none

Description David McCann CLA 2010-10-20 15:29:11 EDT
When XmlElementRef(s) is used with XmlMixed on a non-collection/map property the following exception occurs:


Exception Description: The container class specified [class [Ljavax.xml.bind.JAXBElement;] cannot be used as a container because it does not implement Collection or Map.
	at org.eclipse.persistence.exceptions.ValidationException.illegalContainerClass(ValidationException.java:945)
	at org.eclipse.persistence.internal.queries.ContainerPolicy.buildPolicyFor(ContainerPolicy.java:359)
	at org.eclipse.persistence.internal.queries.ContainerPolicy.buildPolicyFor(ContainerPolicy.java:326)
	at org.eclipse.persistence.oxm.mappings.XMLAnyCollectionMapping.useCollectionClass(XMLAnyCollectionMapping.java:671)
	at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.generateAnyCollectionMapping(MappingsGenerator.java:833)
	at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.generateMappingForReferenceProperty(MappingsGenerator.java:654)
	at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.generateMapping(MappingsGenerator.java:436)
	at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.generateMappings(MappingsGenerator.java:1926)
	at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.generateMappings(MappingsGenerator.java:1891)
	at org.eclipse.persistence.jaxb.compiler.MappingsGenerator.generateProject(MappingsGenerator.java:191)
	at org.eclipse.persistence.jaxb.compiler.Generator.generateProject(Generator.java:176)
	at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:313)
	at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:245)
	... 25 more
Comment 1 Matt MacIvor CLA 2010-11-18 15:50:32 EST
Created attachment 183424 [details]
Proposed Fix
Comment 2 Matt MacIvor CLA 2010-11-18 15:54:22 EST
Attached patch checked in to SVN
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:04:53 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink