IBM Support

PH21285: CLASSCASTEXCEPTION SETTING MAX QUERY RESULTS IN ECLIPSELINK

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

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

[{"Line of Business":{"code":"LOB36","label":"IBM Automation"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"900"}]

Document Information

Modified date:
14 September 2020