PM89276: ENHANCER GENERATES INVALID CODE IF FETCH-GROUPS IS ACTIVATED.

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • After apply iFix  PM78711 ,    a problem with   When set this
    OpenJPA property
    
    <property name="openjpa.DetachState" value="fetch-groups
    (DetachedStateField=true)"/>
    
    OpenJPA implements java.io.Externalizable for every entity. The
    
    Externalizable interface requires two methods:
    writeExternal(..) and
    readExternal(..). Both methods are implemented in a wrong way
    when a class extends a superclass.
    
       Exception in thread "main" java.lang.IllegalAccessError
       at de.continentale.muv.genexternalizable.model.SimpleEntity.
    
       writeExternal(SimpleEntity.java)
       at
    java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.
    
       java:1449)
       ...
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server V8.0.0 who make use of OpenJPA       *
    *                  fetch-groups.                               *
    ****************************************************************
    * PROBLEM DESCRIPTION: Enhancer generates invalid code if      *
    *                      fetch-groups is activated.              *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    If openjpa.DetachState=fetch-groups is used, the
    OpenJPA enhancer will add a 'implements Externalizable' to the
    class, and add a 'writeExternal' and 'readExternal' method.
    The problem is that 'writeExternal' and 'readExternal' will
    also try to externalize the private members of any given
    superclass.  This will cause a runtime exception indicating
    the private members are not accessible, as follows:
    Exception in thread "main" java.lang.IllegalAccessError
    at com.ibm.xxx.yyy.MyEntity.writeExternal(MyEntity.java)
    at java.io.ObjectOutputStream.
    writeExternalData(ObjectOutputStream.java:1449)
    As an example, take the following code snippets:
    @Entity
    public abstract class AbstractGroup {
    ...
    @Temporal(TemporalType.TIMESTAMP)
    private Date applicationBegin;
    ...
    }
    and
    @Entity
    public class Group extends AbstractGroup {
    ...
    }
    This will result in the following generate code which shows
    that private member 'applicationBegin' is accessed:
    public void writeExternal(ObjectOutput objectoutput)
    throws IOException
    {
    pcWriteUnmanaged(objectoutput);
    if(pcStateManager != null)
    {
    if(pcStateManager.writeDetached(objectoutput))
    return;
    } else
    {
    objectoutput.writeObject(pcGetDetachedState());
    objectoutput.writeObject(null);
    }
    objectoutput.writeObject(applicationBegin);
    ...
    

Problem conclusion

  • With this fix, code has been added to OpenJPA to generate
    proper code when openjpa.DetachState=fetch-groups is used.
    
    The fix for this APAR is currently targeted for
    inclusion in Service Level (Fix Pack) 8.0.0.7 of WebSphere
    Application Server versions 8.0.0.
    
    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

    PM89276

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    800

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-05-17

  • Closed date

    2013-07-12

  • Last modified date

    2013-07-22

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

    PM86718

  • 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

  • R800 PSY

       UP



Rate this page:

(0 users)Average rating

Document information


More support for:

WebSphere Application Server
General

Software version:

8.0

Reference #:

PM89276

Modified date:

2013-07-22

Translate my page

Machine Translation

Content navigation