Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Extended Ecore Model Issues(Problems dropping a component to the editor)
Extended Ecore Model Issues [message #1796005] Wed, 03 October 2018 22:51 Go to next message
PM PC is currently offline PM PCFriend
Messages: 12
Registered: May 2018
Junior Member
Hi all.

I have two Ecore Models, let's say A and B.

Ecore A has several classes. One of those classes (with one attribute) is extending the only class of Ecore B (with two attributes).

To set this up in the Ecore A, I went to Load Resources and put Ecore B and associated the correct ESuper Type to the desired class of Ecore A.

After I generated all the code with EuGENia.

So far so good.

The problems appeared when I tried to drop one component to the GMF Editor, getting the following error:

org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:496)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:206)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:169)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:156)
at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:425)
at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:438)
at org.eclipse.gmf.runtime.diagram.ui.tools.CreationTool.performCreation(CreationTool.java:133)
at org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTool.java:189)
at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1200)
at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:301)
at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:380)
at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:221)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4118)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3931)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3534)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1170)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1059)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:667)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:597)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
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:656)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:592)
at org.eclipse.equinox.launcher.Main.run(Main.java:1498)
Caused by: java.lang.ClassCastException: org.eclipse.emf.ecore.impl.DynamicEObjectImpl cannot be cast to thesis.Search
at thesis.diagram.edit.commands.DriveCreateCommand.doExecuteWithResult(DriveCreateCommand.java:60)
at org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand.doExecute(AbstractTransactionalCommand.java:247)
at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
at org.eclipse.gmf.runtime.diagram.ui.commands.SemanticCreateCommand.doExecuteWithResult(SemanticCreateCommand.java:91)
at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403)
at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403)
at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403)
at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:488)
... 38 more

Any help?

Thanks in advance
Re: Extended Ecore Model Issues [message #1796010 is a reply to message #1796005] Thu, 04 October 2018 04:31 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30353
Registered: July 2009
Senior Member
It appears you did not generate both A and B and that the instances you're working with are actually dynamic instances not generated instances. But I can't really comment further without knowing anything about how you created the instances involved.
Re: Extended Ecore Model Issues [message #1796021 is a reply to message #1796010] Thu, 04 October 2018 08:21 Go to previous messageGo to next message
PM PC is currently offline PM PCFriend
Messages: 12
Registered: May 2018
Junior Member
The way I generated all was by going to the genmodel (which contains both Ecores) and clicked Generate All. Isn't that the right way?
Re: Extended Ecore Model Issues [message #1796031 is a reply to message #1796021] Thu, 04 October 2018 10:15 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30353
Registered: July 2009
Senior Member
Yes, but you mentioned EuGENia and I have no idea what that's about or how that's relevant in this picture. And the only problem I see is this in your stack trace:
Caused by: java.lang.ClassCastException: org.eclipse.emf.ecore.impl.DynamicEObjectImpl cannot be cast to thesis.Search
at thesis.diagram.edit.commands.DriveCreateCommand.doExecuteWithResult(DriveCreateCommand.java:60)
But what that code is doing and where the DynamicEObjectImpl is coming from, I can only guess. But you have a debugger and you can set a breakpoint here. You can also set a breakpoint in DynamicEObjectImpl's constructor to see where and why it's being created when your code here is expecting a generated Search instance.
Re: Extended Ecore Model Issues [message #1796032 is a reply to message #1796031] Thu, 04 October 2018 10:40 Go to previous messageGo to next message
PM PC is currently offline PM PCFriend
Messages: 12
Registered: May 2018
Junior Member
I did set a breakpoint before but was unable to start the program. Maybe this is quite obvious but since there's no main class, I'm kinda lost in where to instantiate the debugger mode?

Attached I send the construction of both Ecores.
  • Attachment: Capturar.JPG
    (Size: 40.82KB, Downloaded 58 times)

[Updated on: Thu, 04 October 2018 10:44]

Report message to a moderator

Re: Extended Ecore Model Issues [message #1796051 is a reply to message #1796032] Thu, 04 October 2018 13:02 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30353
Registered: July 2009
Senior Member
Your stack trace shows that you've launched the IDE, but now you're saying you can't or don't know how to launch it under debug control? Just use the debug toolbar button to launch the IDE application just like the run button you used to launch it in order to have seen that stack trace in the first place.
Re: Extended Ecore Model Issues [message #1796084 is a reply to message #1796051] Thu, 04 October 2018 19:19 Go to previous messageGo to next message
PM PC is currently offline PM PCFriend
Messages: 12
Registered: May 2018
Junior Member
I didn't use the launch button as I told you, because it doesn't work, nor does the debug button. The way I ran the program was by going to the plug-in.xml and clicking on "Export deployable plug-ins and fragments". Then after restarting Eclipse, I could create a diagram of my Ecore instance. No launch button was ever clicked, but thanks for your suggestion.

[Updated on: Thu, 04 October 2018 19:23]

Report message to a moderator

Re: Extended Ecore Model Issues [message #1796089 is a reply to message #1796084] Fri, 05 October 2018 03:41 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30353
Registered: July 2009
Senior Member
You should always be able to launch your application without deploying it first. It's just a matter of configuring the launch configuration appropriately, i.e., selecting the appropriate application to run (which looks like an Eclipse application) and perhaps selectively choosing which plugins to include in the launch, though typically just including all the workspace plugins does the trick. You won't be able to effectively develop your solution/application you if can't effectively launch under debug so you really should figure out how to do that.
Re: Extended Ecore Model Issues [message #1796107 is a reply to message #1796089] Fri, 05 October 2018 08:50 Go to previous message
PM PC is currently offline PM PCFriend
Messages: 12
Registered: May 2018
Junior Member
By running the application normally it started working as it should. Afterall it seems like I was the one creating the problem. Thanks Ed Merks.
Previous Topic:load EMF instance model and then create a object in it programmatically
Next Topic:[Xcore/Maven] Xcore code generation with maven
Goto Forum:
  


Current Time: Wed Aug 21 09:11:37 GMT 2019

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

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

Back to the top