Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [COMPARE / TENEO] how can I apply a diff to an existing EObject without the NPE?
[COMPARE / TENEO] how can I apply a diff to an existing EObject without the NPE? [message #610253] Wed, 07 November 2007 01:10
Jason Henriksen is currently offline Jason HenriksenFriend
Messages: 231
Registered: July 2009
Senior Member
Hi All,

I'm getting this exception running EMF Compare in a
WebSphere SOAP service. I can't just call save on the XML backed object
because that will cause Hibernate to do an insert instead of an update.

Caused by: java.lang.Throwable: java.lang.NullPointerException
at ionMetadata(
java.lang.J9VMInternals.initializeImpl(Native Method)

I've gotten one EObject graph out of Teneo and the other from
deserializing a SOAP request. Here's the code:

//--- get an updated EObject from XML
consumerUpdateInput =
consumerXML = consumerUpdateInput.getConsumer();

//--- get the real one from the DB
int consumerKey = consumerXML.getConsumerSK();
consumerSQL = (Consumer)session.load("Consumer",
new Integer(consumerKey));

//--- apply the changes to the DB backed object.
Resource leftRes = new XMLResourceImpl();

Resource rightRes = new XMLResourceImpl();

//!!! This line throws the exception
final MatchModel match = new DifferencesServices().modelMatch(
new NullProgressMonitor(),
Collections.<String, Object> emptyMap());

final DiffModel diff = new DiffMaker().doDiff(match);
EList<DiffElement> e = diff.getOwnedElements();
ListIterator li = e.listIterator();
DiffElement element = (DiffElement);
AbstractMerger merger = MergeFactory.createMerger(element);

//--- save the updated consumer.;

Any help is very much appreciated,

Jason Henriksen
Previous Topic:[CDO] how to handle object update conflicts
Next Topic:UMLProfile vs Ecore
Goto Forum:

Current Time: Thu Apr 25 11:55:44 GMT 2024

Powered by FUDForum. Page generated in 0.02900 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top