You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Madigan, Brian" <BM...@orbitz.com> on 2006/04/28 22:04:28 UTC

NullPointerException in XMLSaveImpl$Lookup

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] org.eclipse.emf.ecore.impl.EAttributeImpl@472d48 (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] org.eclipse.emf.ecore.impl.EAttributeImpl@edf3f6 (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] org.eclipse.emf.ecore.impl.EAttributeImpl@2bc3f5 (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

Re: NullPointerException in XMLSaveImpl$Lookup

Posted by Frank Budinsky <fr...@ca.ibm.com>.
Brian,

This looks like SDO 1 (EMF) code, that is, nothing to do with the Tuscany 
SDO (2) project here.

I'd suggest posting your question to the EMF newsgroup at Eclipse.

Frank.


"Madigan, Brian" <BM...@orbitz.com> wrote on 04/28/2006 04:04:28 PM:

> 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] org.eclipse.emf.ecore.impl.EAttributeImpl@472d48 (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] org.eclipse.emf.ecore.impl.EAttributeImpl@edf3f6 (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] org.eclipse.emf.ecore.impl.EAttributeImpl@2bc3f5 (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