IBM Support

PI97786: ECLIPSELINK THROWS "ARGUMENT TYPE MISMATCH" FOR JPQL CASE EXPRESSION

Fixes are available

18.0.0.2: WebSphere Application Server Liberty 18.0.0.2
9.0.0.9: WebSphere Application Server traditional V9.0 Fix Pack 9
18.0.0.3: WebSphere Application Server Liberty 18.0.0.3
9.0.0.10: WebSphere Application Server traditional V9.0 Fix Pack 10
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
9.0.0.11: WebSphere Application Server traditional V9.0 Fix Pack 11
19.0.0.4: WebSphere Application Server Liberty 19.0.0.4
19.0.0.5: WebSphere Application Server Liberty 19.0.0.5
9.0.5.0: WebSphere Application Server traditional Version 9.0.5 Refresh Pack
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
9.0.5.1: WebSphere Application Server traditional Version 9.0.5 Fix Pack 1
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
9.0.5.2: WebSphere Application Server traditional Version 9.0.5 Fix Pack 2
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
9.0.5.3: WebSphere Application Server traditional Version 9.0.5 Fix Pack 3
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

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • "IllegalArgumentException: argument type mismatch" error when we
    use SUM and CASE in JPQL.
    
    
    
    Here is the exception when the issue happened.
    
    
    [err] java.lang.IllegalArgumentException: argument type mismatch
    
    [err]     at
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
    Method)
    
    [err]     at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeCons
    tructorAccessorImpl.java:83)
    
    [err]     at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Delega
    tingConstructorAccessorImpl.java:57)
    
    [err]     at
    java.lang.reflect.Constructor.newInstance(Constructor.java:437)
    
    [err]     at
    org.eclipse.persistence.internal.security.PrivilegedAccessHelper
    .invokeConstructor(PrivilegedAccessHelper.java:489)
    
    [err]     at
    org.eclipse.persistence.queries.ReportQueryResult.buildResult(Re
    portQueryResult.java:122)
    
    [err]     at [internal classes]
    
    [err]     at
    org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.interna
    lExecuteQuery(UnitOfWorkImpl.java:2899)
    
    [err]     at
    org.eclipse.persistence.internal.sessions.AbstractSession.execut
    eQuery(AbstractSession.java:1863)
    
    [err]     at
    org.eclipse.persistence.internal.sessions.AbstractSession.execut
    eQuery(AbstractSession.java:1845)
    
    [err]     at
    org.eclipse.persistence.internal.sessions.AbstractSession.execut
    eQuery(AbstractSession.java:1810)
    
    [err]     at
    org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(
    QueryImpl.java:258)
    
    [err]     at
    org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(Que
    ryImpl.java:473)
    

Local fix

  • N/A
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server Liberty - Java Persistence APA -     *
    *                  JPA 2.1 & EclipseLink                       *
    ****************************************************************
    * PROBLEM DESCRIPTION: EclipseLink incorrectly handles CASE    *
    *                      & SUM operations by setting the wrong   *
    *                      return type to the function             *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    Example:
    @NamedQuery(
    name="EntityTbl1.dto01a",
    query="SELECT new model.Dto01("
    + "t.itemString1, "
    + "CASE t.itemString2 WHEN 'J' THEN 'Japan' ELSE
    'Other' END, "
    + "SUM(CASE WHEN t.itemString3 = 'C' THEN 1 ELSE 0
    END), "
    + "SUM(CASE WHEN t.itemString4 = 'D' THEN 1 ELSE 0
    END) ) "
    + "FROM EntityTbl01 t "
    + "GROUP BY t.itemString1, t.itemString2")
    public class Dto01 {
    public Dto01(String str1,String str2,String str3,String
    str4) {...}
    public Dto01(String str1,String str2,Integer
    integer1,Integer integer2) {...}
    }
    Test:
    Query query = em.createNamedQuery("EntityTbl1.dto01a");
    List<Dto01> dto01 = query.getResultList();
    Exception:
    UnitOfWork(831207702)--Thread(Thread[main,5,main])--
    java.lang.IllegalArgumentException:
    argument type mismatch
    at
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
    Method)
    at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeCons
    tructorAccessorImpl.java:83)
    at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Delega
    tingConstructorAccessorImpl.java:57)
    at
    java.lang.reflect.Constructor.newInstance(Constructor.java:437)
    at
    org.eclipse.persistence.internal.security.PrivilegedAccessHelper
    .invokeConstructor(PrivilegedAccessHelper.java:489)
    at
    org.eclipse.persistence.queries.ReportQueryResult.buildResult(Re
    portQueryResult.java:122)
    at
    org.eclipse.persistence.queries.ReportQueryResult.<init>(ReportQ
    ueryResult.java:79)
    at
    org.eclipse.persistence.queries.ReportQuery.buildObject(ReportQu
    ery.java:598)
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PI97786

  • 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

    2018-05-10

  • Closed date

    2018-07-12

  • Last modified date

    2018-07-12

  • 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":"BU053","label":"Cloud \u0026 Data Platform"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"900","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
19 October 2021