openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Heath Thomann (JIRA)" <>
Subject [jira] [Created] (OPENJPA-2284) NPE occurs when <cascade-persist/> is added to a <persistence-unit-defaults> in an orm.
Date Thu, 25 Oct 2012 19:09:12 GMT
Heath Thomann created OPENJPA-2284:

             Summary: NPE occurs when <cascade-persist/> is added to a <persistence-unit-defaults>
in an orm.
                 Key: OPENJPA-2284
             Project: OpenJPA
          Issue Type: Bug
          Components: jpa
    Affects Versions: 2.0.3, 2.3.0, 2.2.1
            Reporter: Heath Thomann
            Assignee: Heath Thomann
            Priority: Minor

Take this entity:

public class Simple {

  private int id;
  private String name;

Take this orm.xml entry:

          <!-- The cascade-persist entry causes an issue:      -->

  <entity class="hat.entities.Simple" access="FIELD">
      <id name="id" />
      <basic name="name" />

With this, the following exception will occur:

Caused by: org.xml.sax.SAXException: file:/E:/jpa/openJPAcode/PMR93141/target/test-classes/META-INF/orm.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(
	at org.apache.openjpa.lib.meta.CFMetaDataParser.endElement(
	at org.apache.openjpa.lib.meta.XMLMetaDataParser.endElement(
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(
	at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(
	at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(
	at org.apache.xerces.impl.XMLNamespaceBinder.emptyElement(
	at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(
	at org.apache.xerces.parsers.DTDConfiguration.parse(
	at org.apache.xerces.parsers.DTDConfiguration.parse(
	at org.apache.xerces.parsers.XMLParser.parse(
	at org.apache.xerces.parsers.AbstractSAXParser.parse(
	at javax.xml.parsers.SAXParser.parse(
	at org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource(
	... 60 more

If I comment out the '<cascade-persist/>' entry, all works fine.  Note that in the above
XML I've added the </schema> and <delimited-identifiers/> entries as well.  Neither
of these have an effect on the outcome (they could simply be removed).  I was thinking that
if the issue occurred for the cascade stanza that it might also occur for the <delimited-identifiers/>
entry since the two are similar in their XML definition (XSD).  However, this issue seems
isolated to just the cascade stanza.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message