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

Bug 383424

Summary: Property of an @XmlTransient type gets mapped and marshalled (as a String)
Product: z_Archived Reporter: Michal Politowski <mpol>
Component: EclipselinkAssignee: Denise Smith <denise.mahar>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: blaise.doughan, denise.mahar, mpol
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Proposed changes
none
Proposed changes none

Description Michal Politowski CLA 2012-06-25 07:31:14 EDT
Build Identifier: 

The following model gets marshalled by MOXy (eclipselink-2.4.0-20120623.052549-3369.jar) as:

<?xml version="1.0" encoding="UTF-8"?>
<modelT>
   <prop>property</prop>
   <trans>mpol.moxy.Transient@138c63</trans>
</modelT>

Reference implementation throws javax.xml.bind.MarshalException
 - with linked exception:
[com.sun.istack.internal.SAXException2: class mpol.moxy.Transient nor any of its super class is known to this context.
javax.xml.bind.JAXBException: class mpol.moxy.Transient nor any of its super class is known to this context.]

The test model:

package mpol.moxy;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class ModelT {
    @XmlElement String prop = "property";
    @XmlElement Transient trans = new Transient();
}

package mpol.moxy;

import javax.xml.bind.annotation.XmlTransient;

@XmlTransient
public class Transient {}


Reproducible: Always
Comment 1 Denise Smith CLA 2012-10-19 10:52:05 EDT
Created attachment 222581 [details]
Proposed changes
Comment 2 Denise Smith CLA 2012-10-19 11:16:41 EDT
Created attachment 222584 [details]
Proposed changes
Comment 3 Denise Smith CLA 2012-10-19 13:57:29 EDT
Modified so that an exception will be thrown. Checked in to 2.4 and 2.5 streams.
Comment 4 Denise Smith CLA 2012-10-19 15:11:12 EDT
*** Bug 383429 has been marked as a duplicate of this bug. ***
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:13:55 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink