APAR status
Closed as program error.
Error description
Issue making the openJpa work with WebSphere Applicaton Server. See the error thrown below: [08/04/11 15:53:37:514 UTC] 00000020 SystemOut O <openjpa-1.0.4-SNAPSHOT-r420667:908274 fatal user error> org.apache.openjpa.persistence.ArgumentException: The type for "test.aaa.bbb" is mapped to custom strategy"test.DecimalWrapperValueHandler", but this strategy cannot beinstantiated. at org.apache.openjpa.jdbc.meta.MappingRepository.mappedStrategy(Ma ppingRepository.java:953) at org.apache.openjpa.jdbc.meta.MappingRepository.defaultStrategy(M appingRepository.java:750) :::::::::::::: Caused by: <openjpa-1.0.4-SNAPSHOT-r420667:908274 fatal user error> org.apache.openjpa.persistence.ArgumentException: The class name "test.DecimalWrapperValueHandler" used in a metadata extension on field"test.aaa.bbb" is not valid. at org.apache.openjpa.meta.JavaTypes.classForName(JavaTypes.java:22 7) at org.apache.openjpa.meta.JavaTypes.classForName(JavaTypes.java:19 4)
Local fix
candidate to be fixed in next release
Problem summary
**************************************************************** * USERS AFFECTED: All users of the Java Persistence API * * (JPA) 2.0 feature of the IBM WebSphere * * Application Server V7 Feature Pack for * * OSGi Applications and Java Persistence API * * 2.0 who use an OpenJPA ValueHandler or * * FieldStrategy. * **************************************************************** * PROBLEM DESCRIPTION: OpenJPA doesn't find a ValueHandler * * and/or FieldStrategy class with an * * applicable class loader. * **************************************************************** * RECOMMENDATION: * **************************************************************** When a user's JPA entities makes use of (implement) an OpenJPA 'org.apache.openjpa.jdbc.meta.ValueHandler' or 'org.apache.openjpa.jdbc.meta.FieldStrategy', a potential exists for said classes/implementation to not be found by the current classloader. That is, take the following code as an example: package test; @Entity public class TestEntity { @Id private Long id; @Persistent @Strategy("test.MyStringValueHandler") private String testString; ..... package test; public class MyStringValueHandler extends org.apache.openjpa.jdbc.meta.strats.AbstractValueHandler { ..... When OpenJPA attempts to load the 'MyStringValueHandler' class (the class listed in the @Strategy annotation), it may not be able to load the class depending on the classloader in use. In this case OpenJPA is attempting to load the class with the wrong classloader. Thus the following exception results: org.apache.openjpa.persistence.ArgumentException: The type for "test.TestEntity.testString" is mapped to custom strategy "test.MyStringValueHandler", but this strategy cannot be instantiated.
Problem conclusion
With this fix, code has been added to ensure that OpenJPA uses the correct classloader when it attempts to load a class which has implemented a 'ValueHandler' or 'FieldStrategy' interface. The fix for this APAR is currently targeted for inclusion in Fix Pack 1.0.0.7 for Feature Pack for OSGi Applications and Java Persistence API 2.0. 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
PM41573
Reported component name
JPA OSGI FEATUR
Reported component ID
5724J0857
Reported release
700
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2011-06-14
Closed date
2011-08-12
Last modified date
2011-08-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
JPA OSGI FEATUR
Fixed component ID
5724J0857
Applicable component levels
R700 PSY
UP
[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]
Document Information
Modified date:
29 September 2020