IBM Support

PM33227: JVM Defect IZ92409 - defect in the XML serialization of enumerations

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • THE IBM Java Development Kit fails to serialize XML correctly
    when enumerations are utilized.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    THE IBM Java Development Kit does not serialize XML
    correctly.  The following sample code demonstrates the
    problem:
    
    import java.beans.XMLEncoder;
    import java.io.ByteArrayOutputStream;
    
    public class XMLSerializeEnumTest {
    
    
       public static enum Animal { Dog, Cat, Bear; }
    
       public static class Bean {
          private Animal animal;
          public Animal getAnimal() { return animal; }
          public void setAnimal(Animal animal) { this.animal =
    animal; }
       }
    
       public static void main(String[] args) {
          Bean bean = new Bean();
          bean.setAnimal(Animal.Cat);
          ByteArrayOutputStream baos = new
    ByteArrayOutputStream();
          XMLEncoder xmlEncoder = new XMLEncoder(baos);
          xmlEncoder.writeObject(bean);
          xmlEncoder.close();
          System.out.println(new String(baos.toByteArray()));
       }
    }
    
    This will result in the following output:
    
    Exception during encoding:java.lang.Exception: failed to
    write expression: XMLSerializeEnumTest$Animal=Class.new();
    
    Continue...
    Exception during encoding:java.lang.Exception: failed to
    write expression: XMLSerializeEnumTest$Animal=Class.new();
    
    Continue...
    
    ??xml version="1.0" encoding="UTF-8"??
    ?java version="1.6.0" class="java.beans.XMLDecoder"?
       ?object class="XMLSerializeEnumTest$Bean"/?
    ?/java?
    

Problem conclusion

  • The IBM Java Development Kit has been updated to Java 6 SR9
    which includes the fix for APAR IZ92409.
    
    The fix for this APAR will be included in Rational
    Application Developer version 8.0.2.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM33227

  • Reported component name

    RATL APP DEV WI

  • Reported component ID

    5724J1901

  • Reported release

    800

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-02-21

  • Closed date

    2011-03-11

  • Last modified date

    2011-03-11

  • 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

    RATL APP DEV WI

  • Fixed component ID

    5724J1901

Applicable component levels

  • R800 PSN

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSRTLW","label":"Rational Application Developer for WebSphere Software"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"8.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
11 March 2011