Fixes are available
8.5.5.5: WebSphere Application Server V8.5.5 Fix Pack 5
8.5.5.6: WebSphere Application Server V8.5.5 Fix Pack 6
8.5.5.7: WebSphere Application Server V8.5.5 Fix Pack 7
8.5.5.8: WebSphere Application Server V8.5.5 Fix Pack 8
8.5.5.9: WebSphere Application Server V8.5.5 Fix Pack 9
8.5.5.10: WebSphere Application Server V8.5.5 Fix Pack 10
8.5.5.11: WebSphere Application Server V8.5.5 Fix Pack 11
8.5.5.12: WebSphere Application Server V8.5.5 Fix Pack 12
8.5.5.13: WebSphere Application Server V8.5.5 Fix Pack 13
8.5.5.14: WebSphere Application Server V8.5.5 Fix Pack 14
8.5.5.15: WebSphere Application Server V8.5.5 Fix Pack 15
8.5.5.14: WebSphere Application Server V8.5.5 Fix Pack 14
8.5.5.17: WebSphere Application Server V8.5.5 Fix Pack 17
8.5.5.20: WebSphere Application Server V8.5.5.20
8.5.5.18: WebSphere Application Server V8.5.5 Fix Pack 18
8.5.5.19: WebSphere Application Server V8.5.5 Fix Pack 19
8.5.5.16: WebSphere Application Server V8.5.5 Fix Pack 16
8.5.5.21: WebSphere Application Server V8.5.5.21
APAR status
Closed as program error.
Error description
Try to get an object from my database via entity manager that includes a further object that is annotated with @OneToMany and the parameter "fetch = FetchType.EAGER", I got the following: [ERROR 15:50:40] projectNameRestController.catchEmAll(75) | general error occurred <openjpa-2.2.2-r422266:1468616 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: org.apache.openjpa.util.LongId cannot be cast to de.projectName.domain.test.Parent FailedObject: select p from Parent p [java.lang.String] at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:1027) at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:926) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreMa nager.java:1033) at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.j ava:280) at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectI mpl.java:2381) This was also reported in the open JPA JIRA OPENJPA-2505 https://issues.apache.org/jira/browse/OPENJPA-2505
Local fix
n/a
Problem summary
**************************************************************** * USERS AFFECTED: All users of IBM WebSphere Application * * Server V8.5.5 who make use of the JPA * * CriteriaBuilder. * **************************************************************** * PROBLEM DESCRIPTION: OpenJPA PersistenceException: LongId * * cannot be cast to <class name> * **************************************************************** * RECOMMENDATION: * **************************************************************** The following exception can occur when getting the Criteria Builder from JPA (EntityManagerFactory.getCriteriaBuilder()): org.apache.openjpa.persistence.PersistenceException: org.apache.openjpa.util.LongId cannot be cast to org.apache.openjpa.MyEntity It is difficult to cause this exception and the scenario is very narrow. This exception occurs at runtime when running a JPA query created by JPA Criteria Builder. However, the catalyst for this exception is actually set in place at Criteria Builder initialization (EntityManagerFactory.getCriteriaBuilder()), that is, when a user calls 'getCriteriaBuilder' as the very first operation after creating the EntityManagerFactory. However, the time of the Criteria Builder initialization is not the entire cause of the exception, the issue will only surface when a query is run against a very specific set of data in the database. While the exact scenario is far too complex and technical to properly describe here, suffice it to say that, as mentioned, the issue comes down to the following three things happening: 1) the Criterial Builder is initialized at a specific time 2) a query is run which was built by Criteria Builder, and 3) specific data exists in the database.
Problem conclusion
With this fix, code has been added to OpenJPA to properly synchronize Criteria Builder code to avoid the narrow window of time where this issue can occur. The fix for this APAR is currently targeted for inclusion in Service Level (Fix Pack) 8.5.5.5 of WebSphere Application Server version 8.5.5. Please refer to the recommended updates page for delivery information: http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
Temporary fix
Comments
APAR Information
APAR number
PI26049
Reported component name
WEBSPHERE APP S
Reported component ID
5724J0800
Reported release
850
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2014-09-18
Closed date
2015-01-12
Last modified date
2015-01-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
WEBSPHERE APP S
Fixed component ID
5724J0800
Applicable component levels
R850 PSY
UP
Document Information
Modified date:
28 April 2022