IBM Support

PM78806: Unmarshalling of a JAXB class with unpaired getters/setters may result in an object with missing values

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • The IBM JAXB implementation was ignoring the default binding
    constraints for XmlAccessType.PUBLIC_MEMBER, binding every
    getter/setter regardless of whether they were paired or
    public. Instead of writing to the annotated field, the
    Unmarshaller was searching for a setter method which did not
    exist, silently failing to write the value to the JAXB object.
    This could result in Java object attributes being null after
    unmarshalling.
    

Local fix

  • This problem can be worked around without having to
    to disable the IBM JAXB implementation by adding the
    @XmlAccessorType(XmlAccessType.NONE) annotation to the class.
    
    For example:
    
    @XmlRootElement(name="example")
    @javax.xml.bind.annotation.XmlAccessorType(javax.xml.bind.annota
    tion.Xml
    AccessType.NONE)
    public class ExampleType /*implements Serializable*/{
    ...
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All IBM WebSphere Application Server V7.0   *
    *                  users of JAX-WS and JAXB.                   *
    ****************************************************************
    * PROBLEM DESCRIPTION: Unmarshalling of an XML document into   *
    *                      a JAXB class with unpaired              *
    *                      getters/setters may result in an        *
    *                      object with missing data.               *
    ****************************************************************
    * RECOMMENDATION:  Install a fix pack that contains this       *
    *                  APAR.                                       *
    ****************************************************************
    When a JAXB class has no @XmlAccessType annotation, the
    constraints for XmlAccessType.PUBLIC_MEMBER are used by
    default for determining the XML to object binding. The IBM JAXB
    implementation was ignoring the default binding rules, binding
    every getter/setter regardless of whether they were
    paired or public.
    For example for a class such as:
    @XmlRootElement(name="root")
    public class ExampleType {
    @XmlElement
    private String a;
    public String getA() {
    return a;
    }
    }
    instead of writing to the annotated field "a", the
    JAXB Unmarshaller was searching for a setter method called
    setA() which did not exist, silently failing to write
    the value to the JAXB object. This could result in Java object
    attributes being null after unmarshalling.
    

Problem conclusion

  • The issue was fixed by correcting the JAXB binding logic
    within the IBM JAXB implementation so that it follows the
    default binding rules defined for XmlAccessType.PUBLIC_MEMBER.
    
    The fix for this APAR is currently targeted for inclusion in
    fix pack 7.0.0.29.  Please refer to the Recommended Updates
    page for delivery information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM78806

  • Reported component name

    XML FEATUREPACK

  • Reported component ID

    5724J0856

  • Reported release

    700

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-12-10

  • Closed date

    2013-01-16

  • Last modified date

    2013-01-16

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WEBSPHERE APP S

  • Fixed component ID

    5724J0800

Applicable component levels

  • R700 PSY

       UP



Document information

More support for: WebSphere Application Server
General

Software version: 7.0

Reference #: PM78806

Modified date: 16 January 2013