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

Bug 347862

Summary: propOrder not working with virtual properties
Product: z_Archived Reporter: Blaise Doughan <blaise.doughan>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matt.macivor
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed Fix and Test Case none

Description Blaise Doughan CLA 2011-05-31 16:53:14 EDT
If you specify a propOrder in the oxm.xml file and include virtual properties then you will receive the following exception:

Exception in thread "main" javax.xml.bind.JAXBException: 
Exception Description: The property or field lastName was specified in propOrder but is not a valid property.
 - with linked exception:
[Exception [EclipseLink-50012] (Eclipse Persistence Services - 2.3.0.qualifier): org.eclipse.persistence.exceptions.JAXBException
Exception Description: The property or field lastName was specified in propOrder but is not a valid property.]
	at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:825)
	at org.eclipse.persistence.jaxb.JAXBContext.<init>(JAXBContext.java:136)
	at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:142)
	at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:129)
	at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:93)
	at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:83)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:202)
	at javax.xml.bind.ContextFinder.find(ContextFinder.java:331)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
	at blog.virtual.Demo.main(Demo.java:16)
Caused by: Exception [EclipseLink-50012] (Eclipse Persistence Services - 2.3.0.qualifier): org.eclipse.persistence.exceptions.JAXBException
Exception Description: The property or field lastName was specified in propOrder but is not a valid property.
	at org.eclipse.persistence.exceptions.JAXBException.nonExistentPropertyInPropOrder(JAXBException.java:219)
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.validatePropOrderForInfo(AnnotationsProcessor.java:3321)
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildTypeInfo(AnnotationsProcessor.java:683)
	at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.postBuildTypeInfo(AnnotationsProcessor.java:591)
	at org.eclipse.persistence.jaxb.compiler.XMLProcessor.processXML(XMLProcessor.java:309)
	at org.eclipse.persistence.jaxb.compiler.Generator.<init>(Generator.java:145)
	at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:822)
	... 13 more
Comment 1 Matt MacIvor CLA 2011-06-01 13:32:13 EDT
Created attachment 197118 [details]
Proposed Fix and Test Case
Comment 2 Matt MacIvor CLA 2011-06-01 15:35:40 EDT
Attached patch check in
Reviewed by Blaise Doughan
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:17:11 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:33:07 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink