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
The fix for this APAR changes the OpenJPA implementation and involves an update to the third-party source. See https://issues.apache.org/jira/projects/OPENJPA/issues/OPENJPA-2 882. This fix is currently targeted for WebSphere Application Server 9.0.5.14, 8.5.5.23. For more information, see 'Recommended Updates for WebSphere Application Server': https://www.ibm.com/support/pages/node/715553
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