openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sutter" <kwsut...@gmail.com>
Subject Re: svn commit: r680481 - /openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/unique/orm.xml
Date Wed, 30 Jul 2008 13:12:47 GMT
Craig,
If you would have asked me before seeing the error, I would have thought the
same thing.  But, with the original xml, I received the following error from
the validating parser in the IBM JDK:

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.516 sec
<<< FAILURE!
testMapping(org.apache.openjpa.persistence.jdbc.unique.TestUniqueConstraintWithXMLDescriptor)
Time elapsed: 1.437 sec  <<< ERROR!
<openjpa-1.2.0-SNAPSHOT-r422266:680481M nonfatal general error>
org.apache.openjpa.persistence.PersistenceException:
org.xml.sax.SAXException:
file:/C:/eclipse.workspaces/3.2.2/openjpa-trunk-committed/openjpa-persistence-jdbc/target/test-classes/org/apache/openjpa/persistence/jdbc/unique/orm.xml
[Location: Line: 27, C: 35]: org.xml.sax.SAXParseException:
cvc-complex-type.2.1: Element 'xml-mapping-metadata-complete' must have no
character or element information item [children], because the type's content
type is empty.
        at
org.apache.openjpa.persistence.PersistenceMetaDataFactory.parseXML(Pe
rsistenceMetaDataFactory.java:249)
   :
   :

I surmised from this error that the problem was due to the split xml tag.
The XSD has this element defined as follows:

<xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType"
minOccurs="0"/>

So, I changed it to the single line version and the problem went away.

Kevin

On Mon, Jul 28, 2008 at 4:31 PM, Craig L Russell <Craig.Russell@sun.com>wrote:

> Hi Kevin,
>
> Just for my information, what's wrong with the original xml:
>
>         <persistence-unit-metadata>
>> -               <xml-mapping-metadata-complete>
>> -               </xml-mapping-metadata-complete>
>> +               <xml-mapping-metadata-complete/>
>>        </persistence-unit-metadata>
>>
>
>
> I understand these statements (before versus after) are legal and
> equivalent. But I'm always looking to improve my understanding.
>
> Thanks,
>
> Craig
>
> On Jul 28, 2008, at 1:26 PM, kwsutter@apache.org wrote:
>
>  Author: kwsutter
>> Date: Mon Jul 28 13:26:21 2008
>> New Revision: 680481
>>
>> URL: http://svn.apache.org/viewvc?rev=680481&view=rev
>> Log:
>> OPENJPA-668.  Fixed up the orm.xml file that was used for testing so that
>> it could pass the validation of the IBM JDK parser.
>>
>> Modified:
>>
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/unique/orm.xml
>>
>> Modified:
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/unique/orm.xml
>> URL:
>> http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/unique/orm.xml?rev=680481&r1=680480&r2=680481&view=diff
>>
>> ==============================================================================
>> ---
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/unique/orm.xml
>> (original)
>> +++
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/unique/orm.xml
>> Mon Jul 28 13:26:21 2008
>> @@ -23,8 +23,7 @@
>>        version="1.0">
>>
>>        <persistence-unit-metadata>
>> -               <xml-mapping-metadata-complete>
>> -               </xml-mapping-metadata-complete>
>> +               <xml-mapping-metadata-complete/>
>>        </persistence-unit-metadata>
>>
>>
>> @@ -76,10 +75,8 @@
>>
>>                        <many-to-many name="bs">
>>                                <join-table name="UNIQUE_JOINTABLE_XML">
>> -                                       <join-column name="FK_A_XML"
>> referenced-column-name="aid" nullable="false">
>> -                                       </join-column>
>> -                                       <inverse-join-column
>> name="FK_B_XML" referenced-column-name="bid" nullable="false">
>> -                                       </inverse-join-column>
>> +                                       <join-column name="FK_A_XML"
>> referenced-column-name="aid" nullable="false"/>
>> +                                       <inverse-join-column
>> name="FK_B_XML" referenced-column-name="bid" nullable="false"/>
>>                                        <unique-constraint>
>>
>>  <column-name>FK_A_XML</column-name>
>>
>>  <column-name>FK_B_XML</column-name>
>>
>>
>>
> Craig L Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message