IBM Support

PH21285: CLASSCASTEXCEPTION SETTING MAX QUERY RESULTS IN ECLIPSELINK

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When setting `javax.persistence.Query.setMaxResults(int arg0)`
    on a JPA Query that contains a JOIN on a CollectionTable.
    EclipseLink throws a ClassCastException
    internally
    
    Exception:
    
     Caused by:
    java.lang.ClassCastException:
    org.eclipse.persistence.queries.DataReadQuery incompatible with
    org.eclipse.persistence.queries.ObjectLevelReadQuery
     	at org.ec
    lipse.persistence.mappings.ForeignReferenceMapping.valueFromRowI
    nternal(ForeignReferenceMapping.java:2282)
     	at org.eclipse.pers
    istence.mappings.ForeignReferenceMapping.valueFromRowInternal(Fo
    reignReferenceMapping.java:2212)
     	at org.eclipse.persistence.ma
    ppings.DirectMapMapping.valueFromRowInternalWithJoin(DirectMapMa
    pping.java:1131)
     	at org.eclipse.persistence.mappings.DirectCol
    lectionMapping.valueFromRow(DirectCollectionMapping.java:3157)
    
    ...
     	at org.eclipse.persistence.internal.jpa.QueryImpl.executeR
    eadQuery(QueryImpl.java:262)
     	at org.eclipse.persistence.intern
    al.jpa.QueryImpl.getResultList(QueryImpl.java:482)
    

Local fix

  • N/A
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server                                      *
    ****************************************************************
    * PROBLEM DESCRIPTION: EclipseLink throws an internal          *
    *                      ClassCastException for JOIN query       *
    *                      with Max Results set.                   *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    When setting ´javax.persistence.Query.setMaxResults(int arg0)´
    on a JPA Query that contains a JOIN on a CollectionTable.
    EclipseLink throws a ClassCastException
    internally.
    Exception:
    ´´´
    Caused by:
    java.lang.ClassCastException:
    org.eclipse.persistence.queries.DataReadQuery incompatible with
    org.eclipse.persistence.queries.ObjectLevelReadQuery
    at org.ec
    lipse.persistence.mappings.ForeignReferenceMapping.valueFromRowI
    nternal(ForeignReferenceMapping.java:2282)
    at org.eclipse.pers
    istence.mappings.ForeignReferenceMapping.valueFromRowInternal(Fo
    reignReferenceMapping.java:2212)
    at org.eclipse.persistence.ma
    ppings.DirectMapMapping.valueFromRowInternalWithJoin(DirectMapMa
    pping.java:1131)
    at org.eclipse.persistence.mappings.DirectCol
    lectionMapping.valueFromRow(DirectCollectionMapping.java:3157)
    ...
    at org.eclipse.persistence.internal.jpa.QueryImpl.executeR
    eadQuery(QueryImpl.java:262)
    at org.eclipse.persistence.intern
    al.jpa.QueryImpl.getResultList(QueryImpl.java:482)
    ´´´
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PH21285

  • Reported component name

    WEBS APP SERV N

  • Reported component ID

    5724H8800

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2020-01-21

  • Closed date

    2020-05-29

  • Last modified date

    2020-05-29

  • 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

    WEBS APP SERV N

  • Fixed component ID

    5724H8800

Applicable component levels

  • R900 PSY

       UP

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

Document Information

Modified date:
01 November 2021