Graphical Modeling Framework/Troubleshooting

From Eclipsepedia

< Graphical Modeling Framework
Revision as of 09:03, 10 February 2006 by Rgronback (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This "Newbie's Troubleshooting Guide" was inspired by a series of newsgroup postings contributed by Niclas Hedhman.

Missing classes following generation

  • Scenario:

You generate the "Model Code" and/or "Model Edit" from the .genmodel and you see compile errors, in the form of missing classes.

  • Probable cause:

When you right-click on the top-level element in the .genmodel editor, you will see the same actions available as in the 'package level' node. They are NOT the same. If you accidentally click on the package level one, and have not previously generated code/edit you will not get a warning and instead end up with mysterious compile errors.

  • Remedy:

Make sure you generate from the top-level node, unless you know what you are doing.

  • What GMF could do to make it better:

It would be great if some form of "sanity check" be done during the generation phases, so that this type of confusion could be avoided. Alternatively, different popup menu items, which clearly makes a distinction between the two.

  • Original posting

http://dev.eclipse.org/newslists/news.eclipse.technology.gmf/msg01005.html

  • Comments

This is actually an EMF usage issue, but definitely appropriate to post in the context of GMF.

Generation of packages not as expected

  • Scenario:

In EMF, by giving the top level package name a fully qualified name (e.g. org.hedhman.habba), it at first looks like the base package will be generated correctly. The .genmodel will show that the Base Package has been set up correctly.

However, after generation of the Model Code, "something" resets the package name in the .ecore model and drops everything up to the last dot, i.e. "org.hedhman.habba" is reverted to "habba" for the top level package name.

  • Probable cause:

The Model Code generator seems to be the culprit, as it indeed generates Java code for both "org.hedhman.habba" and "habba" package names in the first run, although I was under the impression that the Model Code generator wouldn't even know of the existence of the .ecore.

  • Remedy:

Don't try to mess with dots in the root level package in the .ecore model, and manually remember to add the Base Package in the .genmodel as described in the GMF tutorial.

  • Original posting

http://dev.eclipse.org/newslists/news.eclipse.technology.gmf/msg01033.html

  • Comments

None.