db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig Russell <Craig.Russ...@Sun.COM>
Subject Re: embedded element problem
Date Wed, 17 Aug 2005 00:50:30 GMT
Hi Michelle,

The jdo and schema look ok to me. The orm has typos "IntField" should  
be "intField" and "StringField" should be "stringField". Don't know  
if the NPE is expected or a more graceful error message should be  
"Unable to find field named "IntField"; perhaps you meant  
"intField"?". ;-)

Craig

On Aug 16, 2005, at 1:20 PM, Michelle Caisse wrote:

> Hi,
>
> Does the metadata and schema below look okay?  I'm getting a  
> NullPointerException.
>
> <jdo>
> <package name="org.apache.jdo.tck.pc.fieldtypes">
> <class name="CollectionCollections" identity-type="application"
>    objectid- 
> class="org.apache.jdo.tck.pc.fieldtypes.CollectionCollections$Oid">
> ...
> <field name="CollectionOfObject1" >
> <collection element- 
> type="org.apache.jdo.tck.pc.fieldtypes.SimpleClass" embedded- 
> element="true">
> </collection>
> </field>
> ...
>
> <orm>
>    <package name="org.apache.jdo.tck.pc.fieldtypes">
>        <class name="CollectionCollections"  
> table="COLLECTION_COLLECTIONS">
> ...
>            <field name="CollectionOfObject1"
>                   table="COLLECTION_OF_OBJECT1">
>                <join column="IDENTIFIER"/>
>                <element>
>                  <embedded>
>                    <field name="id" column="ID"/>
>                    <field name="IntField" column="INTVAL"/>
>                    <field name="StringField" column="STRINGVAL"/>
>                  </embedded>
>                </element>
>            </field>
> ...
> CREATE TABLE COLLECTION_OF_OBJECT1
> (
>    IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL,
>    ID BIGINT NOT NULL,
>    INTVAL INTEGER NOT NULL,
>    STRINGVAL VARCHAR(128) NOT NULL
> );
>
> test(org.apache.jdo.tck.models.fieldtypes.TestCollectionCollections) 
> java.lang.NullPointerException
>    at org.jpox.metadata.EmbeddedMetaData.populate 
> (EmbeddedMetaData.java:121)
>    at org.jpox.metadata.AbstractElementMetaData.populate 
> (AbstractElementMetaData.java:165)
>    at org.jpox.metadata.ElementMetaData.populate 
> (ElementMetaData.java:82)
>    at org.jpox.metadata.FieldMetaData.populate(FieldMetaData.java:736)
>    at org.jpox.metadata.ClassMetaData.populate(ClassMetaData.java:725)
>    at org.jpox.metadata.MetaDataManager.populateClassesInFile 
> (MetaDataManager.java:636)
>    at  
> org.jpox.metadata.MetaDataManager.getFileMetaDataForUrlContainingClass 
> (MetaDataManager.java:1186)
>    at  
> org.jpox.metadata.MetaDataManager.getURLForPackageBasedMetaDataFileHol 
> dingClass(MetaDataManager.java:1269)
>    at  
> org.jpox.metadata.MetaDataManager.getURLForPackageBasedMetaDataFileHol 
> dingClass(MetaDataManager.java:1318)
>    at  
> org.jpox.metadata.MetaDataManager.getURLForPackageBasedMetaDataFileHol 
> dingClass(MetaDataManager.java:1318)
>    at  
> org.jpox.metadata.MetaDataManager.getURLForPackageBasedMetaDataFileHol 
> dingClass(MetaDataManager.java:1318)
>    at  
> org.jpox.metadata.MetaDataManager.getURLForPackageBasedMetaDataFileHol 
> dingClass(MetaDataManager.java:1318)
>    at  
> org.jpox.metadata.MetaDataManager.getURLForPackageBasedMetaDataFileHol 
> dingClass(MetaDataManager.java:1318)
>    at  
> org.jpox.metadata.MetaDataManager.getURLForPackageBasedMetaDataFileHol 
> dingClass(MetaDataManager.java:1318)
>    at  
> org.jpox.metadata.MetaDataManager.getURLForPackageBasedMetaDataFileHol 
> dingClass(MetaDataManager.java:1318)
>    at org.jpox.metadata.MetaDataManager.loadMetaDataForClass 
> (MetaDataManager.java:1147)
>    at  
> org.jpox.metadata.MetaDataManager.getMetaDataForClassOrInterface 
> (MetaDataManager.java:387)
>    at org.jpox.metadata.MetaDataManager.getMetaDataForClass 
> (MetaDataManager.java:311)
>    at  
> org.jpox.AbstractPersistenceManager.hasMetaDataForPersistenceCapableCl 
> ass(AbstractPersistenceManager.java:386)
>    at org.jpox.AbstractPersistenceManager.assertPersistenceCapable 
> (AbstractPersistenceManager.java:417)
>    at org.jpox.AbstractPersistenceManager.internalMakePersistent 
> (AbstractPersistenceManager.java:957)
>    at org.jpox.AbstractPersistenceManager.makePersistent 
> (AbstractPersistenceManager.java:1055)
>    at  
> org.apache.jdo.tck.models.fieldtypes.TestCollectionCollections.runTest 
> (TestCollectionCollections.java:89)
>    at  
> org.apache.jdo.tck.models.fieldtypes.TestCollectionCollections.test 
> (TestCollectionCollections.java:69)
>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>    at sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:39)
>    at sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:25)
>    at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:197)
>    at org.apache.jdo.tck.util.BatchTestRunner.start 
> (BatchTestRunner.java:128)
>    at org.apache.jdo.tck.util.BatchTestRunner.main 
> (BatchTestRunner.java:106)
>
> -- Michelle
>

Craig 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