A fix is available
APAR status
Closed as program error.
Error description
OpenJPA throws Exception when orm.xml contains <cascade-persist/> --> getting the error below: <openjpa-2.0.0-r422266:935683 nonfatal general error> org.apache. openjpa.util.GeneralException: org.xml.sax.SAXException: file:/C: /<user dir>/workspaces/ws-3.7-JSF_CONTI/cp-orm-xml- prob/target/classes/META-INF/orm.xml [Position:<name>: 14, C: 23]: <error here > lang.NullPointerException] at org.apache.openjpa.persistence.PersistenceMetaDataFactory.parseX ML (PersistenceMetaDataFactory.java:295) at org.apache.openjpa.persistence.PersistenceMetaDataFactory.load (PersistenceMetaDataFactory.java:228) at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal --> make reference to opened JIRA: https://issues.apache.org/jira/browse/OPENJPA-2284
Local fix
Candidate to be fix in next release.
Problem summary
**************************************************************** * USERS AFFECTED: All users of IBM WebSphere Application * * Server Liberty Profile * **************************************************************** * PROBLEM DESCRIPTION: OpenJPA throws an exception when an * * orm.xml file contains an empty stanza * **************************************************************** * RECOMMENDATION: * **************************************************************** Take this entity: public class Simple { private int id; private String name; Take this orm.xml entry: MySchema public class Simple { private int id; private String name; Take this orm.xml entry: <persistence-unit-metadata> <persistence-unit-defaults> <schema>MySchema</schema> <delimited-identifiers/> <!-- The cascade-persist entry causes an issue: --> <cascade-persist/> </persistence-unit-defaults> </persistence-unit-metadata> <entity class="hat.entities.Simple" access="FIELD"> <attributes> <id name="id" /> <basic name="name" /> </attributes> </entity> With this, the following exception will occur: Caused by: org.xml.sax.SAXException: file:/E:/jpa/openJPAcode/PMR93141/target/test-classes/META- INF/o rm.xml [Location: Line: 16, C: 23]: An error was encountered while parsing element "id". Make sure the metadata file is correctly formatted. [java.lang.NullPointerException] at org.apache.openjpa.lib.meta.XMLMetaDataParser.getException(XMLMe taDataParser.java:739) at org.apache.openjpa.lib.meta.CFMetaDataParser.endElement(CFMetaDa taParser.java:147) at org.apache.openjpa.lib.meta.XMLMetaDataParser.endElement(XMLMeta DataParser.java:499) at org.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractS AXParser.java:579) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement (AbstractXMLDocumentParser.java:218) at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(XML NamespaceBinder.java:873) at org.apache.xerces.impl.XMLNamespaceBinder.emptyElement(XMLNamesp aceBinder.java:590) at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDVa lidator.java:777) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartE lement(XMLDocumentFragmentScannerImpl.java:748) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentCo ntentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:145 3) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocume nt(XMLDocumentFragmentScannerImpl.java:333) at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguratio n.java:524) at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguratio n.java:580) at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152) at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXPar ser.java:1169) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource(X MLMetaDataParser.java:421) ... 60 more
Problem conclusion
With this fix, code has been added to account for an empty entry in an orm.xml file. The fix for this APAR is currently targeted for inclusion in fix pack 8.5.0.2. 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
PM80452
Reported component name
LIBERTY PROFILE
Reported component ID
5724J0814
Reported release
850
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2013-01-11
Closed date
2013-03-28
Last modified date
2013-03-28
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
LIBERTY PROFILE
Fixed component ID
5724J0814
Applicable component levels
R850 PSY
UP
[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"850","Line of Business":{"code":"LOB45","label":"Automation"}}]
Document Information
Modified date:
29 October 2021