Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Null Pointer Exception after Migrating an Ecore model instance using EDapt(After EDapt migrated my model instance, I got a Null Pointer Exception (generated by org.eclipse.jface plugin when trying to render an icon image) as shown in the attached image files. I tried to debu)
Null Pointer Exception after Migrating an Ecore model instance using EDapt [message #1770977] Sun, 20 August 2017 10:48 Go to next message
Bestoon Jaff is currently offline Bestoon JaffFriend
Messages: 7
Registered: August 2017
Junior Member
Hi,

After a long session of trials and errors, I finally managed to get EDapt to migrate my model instance automatically. To be honest, I have had too much troubles and difficulties using EDapt tool as its poorly documented. The currently available EDapt tutorial and documentation lacking details of how one can register a history with the migrator and what plugins to add to the model and editor plugins, and how to use the migrator extension point, ..etc.

After EDapt migrated my model instance, I got a Null Pointer Exception (generated by org.eclipse.jface plugin when trying to render an icon image) as shown in the attached image files. I tried to debug and find the source of the problem, but I didn't get why the icon is rendered for some of the child nodes (the newly created nodes) but not for the old existing child nodes!

Can someone please help me to fix this problem? As I'm new to EMF and EDapt and can't get my head around this exception.

Any help is highly appreciated,

Many thanks in advance,

Bestoon Jaff
Re: Null Pointer Exception after Migrating an Ecore model instance using EDapt [message #1771064 is a reply to message #1770977] Mon, 21 August 2017 14:53 Go to previous messageGo to next message
Johannes Faltermeier is currently offline Johannes FaltermeierFriend
Messages: 70
Registered: December 2013
Member
Hi,

As mentioned in the other post, you should maybe check out existing documentation about extension points if you are having difficulties using them (e.g. https://wiki.eclipse.org/FAQ_What_are_extensions_and_extension_points%3F)

Regarding your NPE. Do you also get this NPE when you are not migrating an old model with Edapt, i.e. creating a new model from scratch?
My guess would be that you did not re-generate the code for the .edit plugin of your EMF model.

Cheers
Johannes


Johannes Faltermeier

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: Null Pointer Exception after Migrating an Ecore model instance using EDapt [message #1771076 is a reply to message #1771064] Mon, 21 August 2017 18:18 Go to previous messageGo to next message
Bestoon Jaff is currently offline Bestoon JaffFriend
Messages: 7
Registered: August 2017
Junior Member
Hi Johannes,

Thank you very much for your reply, I do appreciate that.

Concerning the NPE that I'm getting, it is only when I use EDapt to migrate my model instances. I have many times created a new instance model without ever getting such NPE. I have also re-generated the Edit plugin. So, I think it has something to do with EDapt and my guess is that it is because EDapt has changed the nsURI of the plugin and this might caused the icon image of the old child nodes to point to an incorrect resource location?!

I do very much appreciate if you could check the project which I attached to this message, to see what has caused the NPE, since I can't find the source of the problem :-(

Thanks,

Jaff

[Updated on: Mon, 21 August 2017 23:44]

Report message to a moderator

Re: Null Pointer Exception after Migrating an Ecore model instance using EDapt [message #1771141 is a reply to message #1771076] Tue, 22 August 2017 12:25 Go to previous messageGo to next message
Johannes Faltermeier is currently offline Johannes FaltermeierFriend
Messages: 70
Registered: December 2013
Member
Hi,

I had a look at your projects. The BookItemProvider has no getImage method. Thus it returns null causing the NPE.
In the genmodel go to Book -> in properties view -> Edit -> Image -> change from false to true -> regenerate edit code

Cheers
Johannes


Johannes Faltermeier

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: Null Pointer Exception after Migrating an Ecore model instance using EDapt [message #1771248 is a reply to message #1771141] Wed, 23 August 2017 11:26 Go to previous message
Bestoon Jaff is currently offline Bestoon JaffFriend
Messages: 7
Registered: August 2017
Junior Member
Hi Johannes,

A huge thank you for your efforts, I do very much appreciate that. You saved my day by diagnosing the source of the NPE.


Kind regards,

Jaff
Previous Topic:Execute migration with Edapt
Next Topic:[Texo] Latest version of texo not published to maven?
Goto Forum:
  


Current Time: Sat Jan 20 07:24:35 GMT 2018

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

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