Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF/Edit][Teneo] Call to AdapterFactoryEditingDomain.getEditingDomainFor(eObject) returns null, eOb
[EMF/Edit][Teneo] Call to AdapterFactoryEditingDomain.getEditingDomainFor(eObject) returns null, eOb [message #1211308] Tue, 26 November 2013 11:16 Go to next message
Marina Knieling is currently offline Marina KnielingFriend
Messages: 83
Registered: February 2013
Member
Hey guys,

in my e4/EMF/ECP application I implemented my own ECPControlContext and
this includes a call to
AdapterFactoryEditingDomain.getEditingDomainFor(eObject). I get a
NullPointerException from that call as it seems that my eObject doesn't
have a resource attached to it.

I'm working with Hibernate/Teneo to store my model elements in a
database and therefore don't create any resources for persistence. Is
that wrong? And how would I incorporate a resource when working with Teneo?

Here is the stacktrace of the Exception:

!ENTRY org.eclipse.e4.ui.workbench 4 0 2013-11-26 12:06:03.561
!MESSAGE Internal Error
!STACK 0
java.lang.NullPointerException
at
org.eclipse.emf.ecp.internal.edit.ECPControlHelper.addModelElementInReference(ECPControlHelper.java:40)
at
com.vknie.comma.core.ui.views.internal.ecp.editor.ECPControlContextImpl.addModelElement(ECPControlContextImpl.java:94)
at
org.eclipse.emf.ecp.edit.internal.swt.actions.NewReferenceAction.run(NewReferenceAction.java:155)
at
org.eclipse.emf.ecp.edit.internal.swt.util.SWTControl$4.widgetSelected(SWTControl.java:368)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
at
org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:162)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

This is line 94 from my ECPControlContextImpl class:
ECPControlHelper.addModelElementInReference(modelElement,
newMEInstance, eReference, getEditingDomain());

This is the call to getEditingDomain()

public EditingDomain getEditingDomain() {
return AdapterFactoryEditingDomain.getEditingDomainFor(modelElement);
}

and this is line 40 from ECPControlHelper where the actual
NullPointerException occurs as editingDomain is null:

editingDomain.getCommandStack().execute(AddCommand.create(editingDomain,
eObject, eReference, newMEInstance));

Thanks in advance
Marina
Re: [EMF/Edit][Teneo] Call to AdapterFactoryEditingDomain.getEditingDomainFor(eObject) returns null, [message #1211970 is a reply to message #1211308] Tue, 26 November 2013 18:03 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Marina,
I don't know that much about editing domains... But there is also a HibernateResource implementation, there are several
ways to load a resource:
http://wiki.eclipse.org/Teneo/Hibernate/EMF_Resource

For general questions on editingdomains and resources I think the EMF newsgroup is better. You should get a quick
response there.

gr. Martin

On 11/26/2013 12:16 PM, Marina Knieling wrote:
> Hey guys,
>
> in my e4/EMF/ECP application I implemented my own ECPControlContext and this includes a call to
> AdapterFactoryEditingDomain.getEditingDomainFor(eObject). I get a NullPointerException from that call as it seems that
> my eObject doesn't have a resource attached to it.
>
> I'm working with Hibernate/Teneo to store my model elements in a database and therefore don't create any resources for
> persistence. Is that wrong? And how would I incorporate a resource when working with Teneo?
>
> Here is the stacktrace of the Exception:
>
> !ENTRY org.eclipse.e4.ui.workbench 4 0 2013-11-26 12:06:03.561
> !MESSAGE Internal Error
> !STACK 0
> java.lang.NullPointerException
> at org.eclipse.emf.ecp.internal.edit.ECPControlHelper.addModelElementInReference(ECPControlHelper.java:40)
> at
> com.vknie.comma.core.ui.views.internal.ecp.editor.ECPControlContextImpl.addModelElement(ECPControlContextImpl.java:94)
> at org.eclipse.emf.ecp.edit.internal.swt.actions.NewReferenceAction.run(NewReferenceAction.java:155)
> at org.eclipse.emf.ecp.edit.internal.swt.util.SWTControl$4.widgetSelected(SWTControl.java:368)
> at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
> at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
> at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:162)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
>
> This is line 94 from my ECPControlContextImpl class:
> ECPControlHelper.addModelElementInReference(modelElement, newMEInstance, eReference, getEditingDomain());
>
> This is the call to getEditingDomain()
>
> public EditingDomain getEditingDomain() {
> return AdapterFactoryEditingDomain.getEditingDomainFor(modelElement);
> }
>
> and this is line 40 from ECPControlHelper where the actual NullPointerException occurs as editingDomain is null:
>
> editingDomain.getCommandStack().execute(AddCommand.create(editingDomain, eObject, eReference, newMEInstance));
>
> Thanks in advance
> Marina


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [EMF/Edit][Teneo] Call to AdapterFactoryEditingDomain.getEditingDomainFor(eObject) returns null, [message #1216333 is a reply to message #1211970] Thu, 28 November 2013 12:29 Go to previous message
Marina Knieling is currently offline Marina KnielingFriend
Messages: 83
Registered: February 2013
Member
Hi Martin,

thanks for your reply. I think, I got the groups mixed up. I thought all
of the EMF stuff was merged into this one. So I'll go and repost my
question in the EMF newsgroup. Thanks anyway.

Marina

Am 26.11.2013 19:03, schrieb Martin Taal:
> Hi Marina,
> I don't know that much about editing domains... But there is also a
> HibernateResource implementation, there are several ways to load a
> resource:
> http://wiki.eclipse.org/Teneo/Hibernate/EMF_Resource
>
> For general questions on editingdomains and resources I think the EMF
> newsgroup is better. You should get a quick response there.
>
> gr. Martin
>
> On 11/26/2013 12:16 PM, Marina Knieling wrote:
>> Hey guys,
>>
>> in my e4/EMF/ECP application I implemented my own ECPControlContext
>> and this includes a call to
>> AdapterFactoryEditingDomain.getEditingDomainFor(eObject). I get a
>> NullPointerException from that call as it seems that
>> my eObject doesn't have a resource attached to it.
>>
>> I'm working with Hibernate/Teneo to store my model elements in a
>> database and therefore don't create any resources for
>> persistence. Is that wrong? And how would I incorporate a resource
>> when working with Teneo?
>>
>> Here is the stacktrace of the Exception:
>>
>> !ENTRY org.eclipse.e4.ui.workbench 4 0 2013-11-26 12:06:03.561
>> !MESSAGE Internal Error
>> !STACK 0
>> java.lang.NullPointerException
>> at
>> org.eclipse.emf.ecp.internal.edit.ECPControlHelper.addModelElementInReference(ECPControlHelper.java:40)
>>
>> at
>> com.vknie.comma.core.ui.views.internal.ecp.editor.ECPControlContextImpl.addModelElement(ECPControlContextImpl.java:94)
>>
>> at
>> org.eclipse.emf.ecp.edit.internal.swt.actions.NewReferenceAction.run(NewReferenceAction.java:155)
>>
>> at
>> org.eclipse.emf.ecp.edit.internal.swt.util.SWTControl$4.widgetSelected(SWTControl.java:368)
>>
>> at
>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
>> at
>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
>> at
>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
>> at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
>>
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:162)
>>
>> at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
>>
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
>>
>> This is line 94 from my ECPControlContextImpl class:
>> ECPControlHelper.addModelElementInReference(modelElement,
>> newMEInstance, eReference, getEditingDomain());
>>
>> This is the call to getEditingDomain()
>>
>> public EditingDomain getEditingDomain() {
>> return
>> AdapterFactoryEditingDomain.getEditingDomainFor(modelElement);
>> }
>>
>> and this is line 40 from ECPControlHelper where the actual
>> NullPointerException occurs as editingDomain is null:
>>
>> editingDomain.getCommandStack().execute(AddCommand.create(editingDomain,
>> eObject, eReference, newMEInstance));
>>
>> Thanks in advance
>> Marina
>
>
Previous Topic:emf.ecore.resource.ResourceSet.getResource takes more time in VIRGO
Next Topic:Compile errors with EEF code from XSD generated EMF model
Goto Forum:
  


Current Time: Tue Apr 23 13:47:55 GMT 2024

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

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

Back to the top