IBM Support

PH41746: OPENJPA ILLEGALARGUMENTEXCEPTION SETTING PERSISTENCE PROPERTIES ON ENTITYMANAGERS

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

  • OpenJPA throws an exception when persistence properties are
    passed to EntityManagers with values that are not expected.
    
    Example:
    ´´´
        Map<String, Object> properties = new HashMap<String,
    Object>();
        properties.put("javax.persistence.lock.timeout", "34567");
        EntityManager em = emf.createEntityManager(properties);
    ´´´
    
    Exception:
    ´´´
    java.lang.IllegalArgumentException: argument type mismatch
     at
    java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(
    Native Method)
     at
    java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(N
    ativeMethodAccessorImpl.java:62)
     at
    java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invo
    ke(DelegatingMethodAccessorImpl.java:43)
     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
     at
    org.apache.openjpa.enhance.Reflection.set(Reflection.java:777)
     at
    org.apache.openjpa.persistence.EntityManagerImpl.setKernelProper
    ty(EntityManagerImpl.java:1936)
     at
    org.apache.openjpa.persistence.EntityManagerImpl.setProperty(Ent
    ityManagerImpl.java:1911)
     at
    org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEn
    tityManager(EntityManagerFactoryImpl.java:258)
     at
    org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEn
    tityManager(EntityManagerFactoryImpl.java:58)
    Caused by: java.lang.IllegalArgumentException: Error while
    setting value 34567 of class java.lang.String by setter method
    public org.apache.openjpa.persistence.jdbc.JDBCFetchPlan
    org.apache.openjpa.persistence.jdbc.JDBCFetchPlanImpl.setLockTim
    eout(int) of instance
    org.apache.openjpa.persistence.jdbc.JDBCFetchPlanImpl@28d133b9
    by reflection.
     at
    org.apache.openjpa.enhance.Reflection.wrapReflectionException(Re
    flection.java:347)
     at
    org.apache.openjpa.enhance.Reflection.set(Reflection.java:779)
    ´´´
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server - Java Persistence API - JPA 2.0 &   *
    *                  OpenJPA                                     *
    ****************************************************************
    * PROBLEM DESCRIPTION: OpenJPA does not properly convert       *
    *                      property values passed to               *
    *                      EntityManagerFactory.createEntityManage *
    *                      r(Map properties)                       *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    OpenJPA throws an exception when persistence properties are
    passed to EntityManagers with values that are not expected.
    Example:
    ```
    Map<String, Object> properties = new HashMap<String,
    Object>();
    properties.put("javax.persistence.lock.timeout", "34567");
    EntityManager em = emf.createEntityManager(properties);
    ```
    Exception:
    ```
    java.lang.IllegalArgumentException: argument type mismatch
    at
    java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(
    Native Method)
    at
    java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(N
    ativeMethodAccessorImpl.java:62)
    at
    java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invo
    ke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at
    org.apache.openjpa.enhance.Reflection.set(Reflection.java:777)
    at
    org.apache.openjpa.persistence.EntityManagerImpl.setKernelProper
    ty(EntityManagerImpl.java:1936)
    at
    org.apache.openjpa.persistence.EntityManagerImpl.setProperty(Ent
    ityManagerImpl.java:1911)
    at
    org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEn
    tityManager(EntityManagerFactoryImpl.java:258)
    at
    org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEn
    tityManager(EntityManagerFactoryImpl.java:58)
    Caused by: java.lang.IllegalArgumentException: Error while
    setting value 34567 of class java.lang.String by setter method
    public org.apache.openjpa.persistence.jdbc.JDBCFetchPlan
    org.apache.openjpa.persistence.jdbc.JDBCFetchPlanImpl.setLockTim
    eout(int) of instance
    org.apache.openjpa.persistence.jdbc.JDBCFetchPlanImpl@28d133b9
    by reflection.
    at
    org.apache.openjpa.enhance.Reflection.wrapReflectionException(Re
    flection.java:347)
    at
    org.apache.openjpa.enhance.Reflection.set(Reflection.java:779)
    ```
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PH41746

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2021-11-01

  • Closed date

    2022-11-21

  • Last modified date

    2022-11-21

  • 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

    WEBSPHERE APP S

  • Fixed component ID

    5724J0800

Applicable component levels

[{"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:
22 November 2022