IBM Support

PI59757: JPA PersistenceUnitUtil.getIdentifier() fails for nested Embedde dId

Fixes are available

16.0.0.2: WebSphere Application Server Liberty 16.0.0.2
16.0.0.3: WebSphere Application Server Liberty 16.0.0.3
16.0.0.4: WebSphere Application Server Liberty 16.0.0.4
17.0.0.1: WebSphere Application Server Liberty 17.0.0.1
17.0.0.2: WebSphere Application Server Liberty 17.0.0.2
17.0.0.3: WebSphere Application Server Liberty 17.0.0.3
17.0.0.4: WebSphere Application Server Liberty 17.0.0.4
18.0.0.1: WebSphere Application Server Liberty 18.0.0.1
18.0.0.2: WebSphere Application Server Liberty 18.0.0.2
18.0.0.3: WebSphere Application Server Liberty 18.0.0.3
18.0.0.4: WebSphere Application Server Liberty 18.0.0.4
19.0.0.1: WebSphere Application Server Liberty 19.0.0.1
19.0.0.2: WebSphere Application Server Liberty 19.0.0.2
19.0.0.3: WebSphere Application Server Liberty 19.0.0.3
19.0.0.4: WebSphere Application Server Liberty 19.0.0.4
19.0.0.5: WebSphere Application Server Liberty 19.0.0.5
19.0.0.6: WebSphere Application Server Liberty 19.0.0.6
19.0.0.7: WebSphere Application Server Liberty 19.0.0.7
19.0.0.8: WebSphere Application Server Liberty 19.0.0.8
19.0.0.9: WebSphere Application Server Liberty 19.0.0.9
19.0.0.10: WebSphere Application Server Liberty 19.0.0.10
19.0.0.11: WebSphere Application Server Liberty 19.0.0.11
19.0.0.12: WebSphere Application Server Liberty 19.0.0.12
20.0.0.1: WebSphere Application Server Liberty 20.0.0.1
20.0.0.2: WebSphere Application Server Liberty 20.0.0.2
20.0.0.3: WebSphere Application Server Liberty 20.0.0.3
20.0.0.4: WebSphere Application Server Liberty 20.0.0.4
20.0.0.5: WebSphere Application Server Liberty 20.0.0.5
20.0.0.6: WebSphere Application Server Liberty 20.0.0.6
20.0.0.7: WebSphere Application Server Liberty 20.0.0.7
20.0.0.8: WebSphere Application Server Liberty 20.0.0.8
20.0.0.9: WebSphere Application Server Liberty 20.0.0.9
20.0.0.10: WebSphere Application Server Liberty 20.0.0.10
20.0.0.11: WebSphere Application Server Liberty 20.0.0.11
20.0.0.12: WebSphere Application Server Liberty 20.0.0.12
21.0.0.3: WebSphere Application Server Liberty 21.0.0.3
21.0.0.4: WebSphere Application Server Liberty 21.0.0.4
21.0.0.5: WebSphere Application Server Liberty 21.0.0.5
21.0.0.6: WebSphere Application Server Liberty 21.0.0.6
21.0.0.7: WebSphere Application Server Liberty 21.0.0.7
21.0.0.8: WebSphere Application Server Liberty 21.0.0.8
21.0.0.9: WebSphere Application Server Liberty 21.0.0.9
21.0.0.1: WebSphere Application Server Liberty 21.0.0.1
21.0.0.2: WebSphere Application Server Liberty 21.0.0.2
21.0.0.10: WebSphere Application Server Liberty 21.0.0.10
21.0.0.11: WebSphere Application Server Liberty 21.0.0.11
21.0.0.12: WebSphere Application Server Liberty 21.0.0.12
22.0.0.1: WebSphere Application Server Liberty 22.0.0.1
22.0.0.2: WebSphere Application Server Liberty 22.0.0.2
22.0.0.3: WebSphere Application Server Liberty 22.0.0.3
22.0.0.4: WebSphere Application Server Liberty 22.0.0.4

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The call:
    
    entityManager.getEntityManagerFactory().getPersistenceUnitUt
    il()
    .getIdentifier(entity);
    
    fails for an entity, that has an emdedded id, that contains
    a
    nested embedded value.
    
    The exception stacktrace is:
    
    org.eclipse.persistence.exceptions.DescriptorException:
    Exception Description: An internal error occurred accessing
    the
    primary key object [eclipselinkbug.SomeEmbeddedId@8db42518].
    Internal Exception: java.lang.IllegalArgumentException: Can
    not
    set eclipselinkbug.SomeEmbeddedValue field
    eclipselinkbug.SomeEmbeddedId.value to java.lang.String
    Descriptor: RelationalDescriptor(eclipselinkbug.SomeEntity
    --> [DatabaseTable(SOMEENTITY)])
    at
    org.eclipse.persistence.exceptions.DescriptorException.error
    Usin
    gPrimaryKey(DescriptorException.java:1937)
    at
    org.eclipse.persistence.internal.jpa.CMP3Policy$FieldAccesso
    r.se
    tValue(CMP3Policy.java:689)
    at
    org.eclipse.persistence.descriptors.CMPPolicy.createPrimaryK
    eyIn
    stance(CMPPolicy.java:460)
    at
    org.eclipse.persistence.internal.jpa.EntityManagerFactoryImp
    l.ge
    tIdentifier(EntityManagerFactoryImpl.java:91)
    at
    org.eclipse.persistence.internal.jpa.EntityManagerFactoryDel
    egat
    e.getIdentifier(EntityManagerFactoryDelegate.java:724)
    ... 14 more
    Caused by: java.lang.IllegalArgumentException: Can not set
    eclipselinkbug.SomeEmbeddedValue field
    eclipselinkbug.SomeEmbeddedId.value to java.lang.String
    at
    sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentE
    xcep
    tion(UnsafeFieldAccessorImpl.java:179)
    at
    sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentE
    xcep
    tion(UnsafeFieldAccessorImpl.java:183)
    at
    sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFi
    eldA
    ccessorImpl.java:93)
    at java.lang.reflect.Field.set(Field.java:774)
    at
    org.eclipse.persistence.internal.security.PrivilegedAccessHe
    lper
    .setValueInField(PrivilegedAccessHelper.java:436)
    at
    org.eclipse.persistence.internal.jpa.CMP3Policy$FieldAccesso
    r.se
    tValue(CMP3Policy.java:686)
    ... 17 more
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All IBM WebSphere Application Server        *
    *                  Liberty users of the JPA 2.1 feature        *
    ****************************************************************
    * PROBLEM DESCRIPTION: PersistenceUnitUtil.getIdentifier()     *
    *                      throws java.lang.NoSuchFieldException   *
    *                      for nested EmbeddedId                   *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    Attempting to call the PersistenceUnitUtil.getIdentifier() with
    an entity that has a nested Embeddable in an EmbeddedId results
    in a java.lang.NoSuchFieldException for the nested Embeddable's
    fields.
    Documented and tracked as an EclipseLink bug:
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=490114
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PI59757

  • Reported component name

    WAS LIBERTY COR

  • Reported component ID

    5725L2900

  • Reported release

    855

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-03-25

  • Closed date

    2016-04-22

  • Last modified date

    2016-06-14

  • 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

    WAS LIBERTY COR

  • Fixed component ID

    5725L2900

Applicable component levels

  • R855 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSD28V","label":"WebSphere Application Server Liberty Core"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"855","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
03 May 2022