I am trying to save an SDO which I created using the EMF APIs. I am
using the following code found in the 'Introduction to SDO' example to
print out the result as XML:

          EDataGraph dg = SDOFactory.eINSTANCE.createEDataGraph();
        dg.setERootObject(eObject);
        dg.getDataGraphResource().save(System.out, null);

 I get an NPE down in
XMLSaveImpl$Lookup.featureKind(EStructuralFeature).

 [junit] ------------- Standard Output ---------------
    [junit] Creating DataObject
                <-- the DataObject -->
    [junit] PurchaseImpl
    [junit] [EMAIL PROTECTED] (name:
MemberId) (ordered: true, unique: true, lowerBound: 0, upperBound: 1)
(changeable: true, volatile: false, transient: false,
defaultValueLiteral: null, unsettable: false, derived: false) (iD:
false)
    [junit] [EMAIL PROTECTED] (name:
BookingId) (ordered: true, unique: true, lowerBound: 0, upperBound: 1)
(changeable: true, volatile: false, transient: false,
defaultValueLiteral: null, unsettable: false, derived: false) (iD:
false)
    [junit] [EMAIL PROTECTED] (name:
Agency) (ordered: true, unique: true, lowerBound: 0, upperBound: 1)
(changeable: true, volatile: false, transient: false,
defaultValueLiteral: null, unsettable: false, derived: false) (iD:
false)
    [junit] ------------- ---------------- ---------------
    [junit] Testcase:
testToDataObject(com.orbitz.transform.Sdo2PojoTest):      Caused an
ERROR
    [junit] null
    [junit] java.lang.NullPointerException
    [junit]     at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl$Lookup.featureKind(XMLSaveImp
l.java:2589)
    [junit]     at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl$Lookup.listKinds(XMLSaveImpl.
java:2500)
    [junit]     at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl$Lookup.getFeatures(XMLSaveImp
l.java:2437)
    [junit]     at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java
:1046)
    [junit]     at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.jav
a:2377)
    [junit]     at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(XMLSaveImpl.ja
va:577)
    [junit]     at
org.eclipse.emf.ecore.sdo.util.DataGraphResourceFactoryImpl$DataGraphRes
ourceImpl$SaveImpl.traverse(DataGraphResourceFactoryImpl.java:388)
    [junit]     at
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:229)
    [junit]     at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.ja
va:198)
    [junit]     at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:
971)
    [junit]     at
com.orbitz.transform.Sdo2PojoTest.testToDataObject(Sdo2PojoTest.java:68)
    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
    [junit]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
    [junit]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)


I am looking for the EMF source code for the version we are working with
currently so I can see what's going on, but I think this might be caused
by something I am not doing while creating the EClass info for the
object being serialized. ??
Thanks,

Brian Madigan
Senior Software Engineer
www.orbitz.com

Reply via email to