Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF problem(error message)
GMF problem [message #516159] Mon, 22 February 2010 22:44 Go to next message
Torbj is currently offline TorbjFriend
Messages: 2
Registered: February 2010
Junior Member
Hi

I am new to modeling, and recently started using GMF. After going through part 1 & 2 of the mindmap tutorial, i started a new project from scratch, but i ran into some problems. Basically, as far as i have gotten, i have 1 Eclass that i would like to generate for. When trying to generate a genmodel, i get these error messages of the type:

"Validation failed unexpectedly for", followed by the name of each of the elements in my mapping. The error messages in the log all says the same:

java.lang.ClassCastException: org.eclipse.gmf.gmfgraph.impl.NodeImpl cannot be cast to org.eclipse.gmf.gmfgraph.DiagramLabel
at org.eclipse.gmf.mappings.impl.LabelMappingImpl.getDiagramLab el(LabelMappingImpl.java:93)
at org.eclipse.gmf.mappings.impl.LabelMappingImpl.eGet(LabelMap pingImpl.java:207)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1013)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1005)
at org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImp l.hasNext(EContentsEList.java:409)
at org.eclipse.emf.ecore.util.EObjectValidator.validate_EveryPr oxyResolves(EObjectValidator.java:432)
at org.eclipse.emf.ecore.util.EObjectValidator.validate_EveryDe faultConstraint(EObjectValidator.java:209)
at org.eclipse.emf.ecore.util.EObjectValidator.validate(EObject Validator.java:190)
at org.eclipse.gmf.internal.validate.ValidatorChain.validate(Va lidatorChain.java:67)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:164)
at org.eclipse.gmf.internal.bridge.transform.ValidationHelper$S martDiagnostician.validate(ValidationHelper.java:96)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:143)
at org.eclipse.emf.ecore.util.Diagnostician.doValidateContents( Diagnostician.java:179)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:167)
at org.eclipse.gmf.internal.bridge.transform.ValidationHelper$S martDiagnostician.validate(ValidationHelper.java:96)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:143)
at org.eclipse.emf.ecore.util.Diagnostician.doValidateContents( Diagnostician.java:179)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:167)
at org.eclipse.gmf.internal.bridge.transform.ValidationHelper$S martDiagnostician.validate(ValidationHelper.java:96)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:143)
at org.eclipse.emf.ecore.util.Diagnostician.doValidateContents( Diagnostician.java:183)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:167)
at org.eclipse.gmf.internal.bridge.transform.ValidationHelper$S martDiagnostician.validate(ValidationHelper.java:96)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:143)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:114)
at org.eclipse.gmf.internal.bridge.transform.ValidationHelper.v alidate(ValidationHelper.java:288)
at org.eclipse.gmf.internal.bridge.transform.TransformToGenMode lOperation.loadMappingModel(TransformToGenModelOperation.jav a:160)
at org.eclipse.gmf.internal.bridge.transform.MapModelConfigurat ionPage.doLoadResource(MapModelConfigurationPage.java:36)
at org.eclipse.gmf.internal.bridge.transform.ModelConfiguration Page$1.execute(ModelConfigurationPage.java:53)
at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Worksp aceModifyOperation.java:106)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1800)
at org.eclipse.ui.actions.WorkspaceModifyOperation.run(Workspac eModifyOperation.java:118)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:372)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java: 944)
at org.eclipse.gmf.internal.bridge.transform.ModelConfiguration Page.loadResource(ModelConfigurationPage.java:67)
at org.eclipse.gmf.internal.common.ui.ModelSelectionPage.update URI(ModelSelectionPage.java:290)
at org.eclipse.gmf.internal.common.ui.ModelSelectionPage.initCo ntrols(ModelSelectionPage.java:275)
at org.eclipse.gmf.internal.common.ui.ModelSelectionPage.setVis ible(ModelSelectionPage.java:382)
at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDi alog.java:1171)
at org.eclipse.jface.wizard.WizardDialog.access$2(WizardDialog. java:1149)
at org.eclipse.jface.wizard.WizardDialog$5.run(WizardDialog.jav a:1138)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog. java:1136)
at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDial og.java:830)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:369)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.gmf.internal.bridge.transform.TransformToGenMode lAction.run(TransformToGenModelAction.java:72)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:251)
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
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(EclipseS tarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)

Does anyone have an idea of what could cause this?

Cheers!
Re: GMF problem [message #516168 is a reply to message #516159] Mon, 22 February 2010 23:25 Go to previous messageGo to next message
Luis Rocha is currently offline Luis RochaFriend
Messages: 8
Registered: February 2010
Junior Member
Hi Torbj,

I am new to modeling too, but it seems that you might have Feature Label Mapping elements in your gmfgraph without the Diagram Label attribute set. If you create the gmfgraph by using the Wizard, they might not be set automatically. For more information, see the following tutorial:

http://www.javaexpress.pl/article/show/Graphical_Modelling_F ramework

I hope this helps.

Luis
Re: GMF problem [message #516243 is a reply to message #516159] Tue, 23 February 2010 10:47 Go to previous message
Torbj is currently offline TorbjFriend
Messages: 2
Registered: February 2010
Junior Member
I started over a bit, to simplify even more..

Right now, my ecore model consists of an Eclass called Class, which is contained in a DocumentRoot Eclass. The tool palette is generated straight forward i guess.. The gmfgraph contains a figure descriptor ClassFigure, which contains a Rectangle ClassFigure, which again contains a label ClassNameFigure. I also have a child access getFigureClassNameFigure, which points to the ClassNameFigure label. The node class has figure descriptor ClassFigure as a figure, and diagram label ClassFigure has the child access mentioned as accessor, and figure descriptor ClassFigure as figure.

In mappings, i have a top node reference with containment feature DocumentRoot .classRoot:Class. I then have a node mapping, with domain meta information element Class, diagram node Node Class, and tool creation tool Class. With this, i can generate a generator model (although when running i can't actually draw anything ). But, when i try to add a label mapping (feature label or label), i get error messages like before (slight difference from before in the casting though):

java.lang.ClassCastException: org.eclipse.gmf.gmfgraph.impl.FigureDescriptorImpl cannot be cast to org.eclipse.gmf.gmfgraph.DiagramLabel
at org.eclipse.gmf.mappings.impl.LabelMappingImpl.getDiagramLab el(LabelMappingImpl.java:93)
at org.eclipse.gmf.mappings.impl.LabelMappingImpl.eGet(LabelMap pingImpl.java:207)
at org.eclipse.gmf.mappings.impl.FeatureLabelMappingImpl.eGet(F eatureLabelMappingImpl.java:337)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1013)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1005)
at org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImp l.hasNext(EContentsEList.java:409)
at org.eclipse.emf.ecore.util.EcoreUtil$CrossReferencer.handleC rossReference(EcoreUtil.java:1692)
at org.eclipse.emf.ecore.util.EcoreUtil$CrossReferencer.crossRe ference(EcoreUtil.java:1670)
at org.eclipse.emf.ecore.util.EcoreUtil$ExternalCrossReferencer .findExternalCrossReferences(EcoreUtil.java:1906)
at org.eclipse.emf.ecore.util.EcoreUtil$ExternalCrossReferencer .find(EcoreUtil.java:1918)
at org.eclipse.gmf.internal.validate.ExternModelImport.initiali zeExternPackages(ExternModelImport.java:142)
at org.eclipse.gmf.internal.validate.ExternModelImport.getImpor ter(ExternModelImport.java:99)
at org.eclipse.gmf.internal.validate.AnnotatedOclValidator.hand leMetaModel(AnnotatedOclValidator.java:72)
at org.eclipse.gmf.internal.validate.AnnotatedOclValidator.vali date(AnnotatedOclValidator.java:47)
at org.eclipse.gmf.internal.validate.ValidatorChain.validate(Va lidatorChain.java:67)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:164)
at org.eclipse.gmf.internal.bridge.transform.ValidationHelper$S martDiagnostician.validate(ValidationHelper.java:96)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:143)
at org.eclipse.emf.ecore.util.Diagnostician.doValidateContents( Diagnostician.java:183)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:167)
at org.eclipse.gmf.internal.bridge.transform.ValidationHelper$S martDiagnostician.validate(ValidationHelper.java:96)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:143)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:114)
at org.eclipse.gmf.internal.bridge.transform.ValidationHelper.v alidate(ValidationHelper.java:288)
at org.eclipse.gmf.internal.bridge.transform.TransformToGenMode lOperation.loadMappingModel(TransformToGenModelOperation.jav a:160)
at org.eclipse.gmf.internal.bridge.transform.MapModelConfigurat ionPage.doLoadResource(MapModelConfigurationPage.java:36)
at org.eclipse.gmf.internal.bridge.transform.ModelConfiguration Page$1.execute(ModelConfigurationPage.java:53)
at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Worksp aceModifyOperation.java:106)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1800)
at org.eclipse.ui.actions.WorkspaceModifyOperation.run(Workspac eModifyOperation.java:118)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:372)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java: 944)
at org.eclipse.gmf.internal.bridge.transform.ModelConfiguration Page.loadResource(ModelConfigurationPage.java:67)
at org.eclipse.gmf.internal.common.ui.ModelSelectionPage.update URI(ModelSelectionPage.java:290)
at org.eclipse.gmf.internal.common.ui.ModelSelectionPage.initCo ntrols(ModelSelectionPage.java:275)
at org.eclipse.gmf.internal.common.ui.ModelSelectionPage.setVis ible(ModelSelectionPage.java:382)
at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDi alog.java:1171)
at org.eclipse.jface.wizard.WizardDialog.access$2(WizardDialog. java:1149)
at org.eclipse.jface.wizard.WizardDialog$5.run(WizardDialog.jav a:1138)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog. java:1136)
at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDial og.java:830)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:369)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3493)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3112)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.gmf.internal.bridge.transform.TransformToGenMode lAction.run(TransformToGenModelAction.java:72)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:251)
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3493)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3112)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
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(EclipseS tarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)

Edit: Started over again, and now it works.. gotta love gmf error messages though Razz

[Updated on: Tue, 23 February 2010 13:20]

Report message to a moderator

Previous Topic:How to mark Nodes
Next Topic:PropertySheet/Common Navigator problem
Goto Forum:
  


Current Time: Mon Sep 28 07:11:36 GMT 2020

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

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

Back to the top