Community
Participate
Working Groups
Build Identifier: 2.2.0.v20110202-r8913 While finalizing properties @XmlTransient marked properties got skipped <xml-transient/> marked ones not. These can break context creation in case the property points to an transient marked class and throws JAXBException. Exception: JAXBException - Property [*] in class [*] references a class [*] that is marked transient, which is not allowed. on: finalizeProperties(AnnotationsProcessor.java:648) The error is caused on AnnotationsProcessor: 599 // add properties 600 info.setProperties(getPropertiesForClass(javaClass, info)); 601 602 // process properties 603 processTypeInfoProperties(javaClass, info); An possible solution would be when processTypeInfoProperties(*) finds out that a property is transient via orm it should be removed from TypeInfo internal list. Reproducible: Always Steps to Reproduce: 1. use orm to mark an property and its type transient 2. try to create an JAXBContext
http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/XMLProcessor.java Index: XMLProcessor.java =================================================================== --- XMLProcessor.java (Revision 9398) +++ XMLProcessor.java (Arbeitskopie) @@ -453,6 +453,10 @@ } processJavaAttribute(typeInfo, javaAttribute, propToProcess, nsInfo, javaType); + // (Bug 346081) if discover an transient attribute apply same behavior as transient annotation and remove + if(propToProcess.isTransient()){ + typeInfo.getPropertyList().remove(propToProcess); + } // if we are dealing with multiple mappings for the same attribute, leave the existing // property as-is and update the additionalProperties list on the owning TypeInfo
Created attachment 195868 [details] Possible solution
Created attachment 196115 [details] Patch as proposed plus test case
Fixed to remove the property from the list of properties if it is transient as proposed.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink