Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Error in generated refreshSemantic() (eugenia generates code with errors in package.diagram.edit.policies)
Error in generated refreshSemantic() [message #893240] Tue, 03 July 2012 10:16 Go to next message
Nikolay Manolov is currently offline Nikolay ManolovFriend
Messages: 24
Registered: June 2012
Junior Member
Eugenia generates everything successfully (so it says) but then there are some errors in package.diagram.edit.policies in some of the <nodeName>CanonicalEditPolicy.java files.

the error appears in the following snippet
protected void refreshSemantic() {
		if (resolveSemanticElement() == null) {
			return;
		}
		LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
		List<TransportingNodeDescriptor> childDescriptors = TransportingDiagramUpdater
				.getCustomer_2003SemanticChildren((View) getHost().getModel()); // !!! The method getCustomer_2003SemanticChildren(View) is undefined for the type TransportingDiagramUpdater

		LinkedList<View> orphaned = new LinkedList<View>();
		// we care to check only views we recognize as ours
		LinkedList<View> knownViewChildren = new LinkedList<View>();
		for (View v : getViewChildren()) {
			if (isMyDiagramElement(v)) {
				knownViewChildren.add(v);
			}

		}
......


it is always in the refreshSemantic function and the error is
"The method getCustomer_2003SemanticChildren(View) is undefined for the type TransportingDiagramUpdater"
it suggests that the name is changed to getSemanticChildren(). If I do that manually it seems to work. But I have to change it in a lot of files.
If ignore the error and start the Editor. I manage to open it but when I start "drawing" it stops responding. I wouldn't know if that is a problem with my .emf file because the editor sporadically crashes anyways (I am still learning).

I don't know if those errors and correcting them matter at all, since after I correct the errors , no code is being generated. I just proceed to start the editor.

My .emf file looks like this
@namespace(uri="transporter", prefix="transporter")
@gmf(foo="bar")

package transporting;

@gmf.diagram(foo="bar")
class Logistics {
   val Stuff[*] stuff;
   val Customer[*] customers;
   val Transporter[*] transporters;
   //val Llabel[*] labels;
   val Box[*] boxes;
}

class Node{
   attr String name;
}

@gmf.node(label="name")
class Customer extends Node{
   @gmf.link(sytle="dash")
   ref Llabel[*] belongs_to;
}

@gmf.link(target.decoration="arrow", sytle="dash")
class Customer_Owns_Box{
   	ref Customer source;
    ref Box target;
}

@gmf.node(label="name")
class Stuff extends Node{
}

@gmf.node(label="name")
class Box extends Stuff{
	@gmf.link(label="member")
   val Llabel[*] on;
	@gmf.compartment(foo="bar")
   val Stuff[*] contents;
}

@gmf.node(label="name", phantom="true")
class Llabel extends Node{
}

@gmf.node(label="name")
class Transporter extends Node{
   @gmf.compartment(foo="bar")
   val Box[*] boxes;
}



Any ideas?

EDIT:
Actually fixing the errors in the java code does seem to affect the Editor for the better. It crashes only when I try to place The label node in the diagram. So I am guessing the problem lies within the label. Still I am clueless.

EDIT2:

Actually just starting the a new Eclipse instance produces an error

!ENTRY org.eclipse.gmf.runtime.diagram.ui 4 2 2012-07-03 12:41:18.516
!MESSAGE IRJS0007E Semantic refresh failed.
!STACK 0
java.lang.ClassCastException: phantom.impl.MemberImpl cannot be cast to phantom.Model
	at phantom.diagram.part.PhantomDiagramUpdater.getModel_1000SemanticChildren(PhantomDiagramUpdater.java:61)
	at phantom.diagram.edit.policies.MemberCanonicalEditPolicy.refreshSemantic(MemberCanonicalEditPolicy.java:81)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy.refresh(CanonicalEditPolicy.java:961)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy.refreshOnActivate(CanonicalEditPolicy.java:638)
	at phantom.diagram.edit.policies.MemberCanonicalEditPolicy.refreshOnActivate(MemberCanonicalEditPolicy.java:45)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy.activate(CanonicalEditPolicy.java:628)
	at org.eclipse.gef.editparts.AbstractEditPart.activateEditPolicies(AbstractEditPart.java:174)
	at org.eclipse.gef.editparts.AbstractEditPart.activate(AbstractEditPart.java:156)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.activate(AbstractGraphicalEditPart.java:195)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$0(GraphicalEditPart.java:1)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.activate(GraphicalEditPart.java:205)
	at phantom.diagram.edit.policies.ModelCanonicalEditPolicy.refreshOnActivate(ModelCanonicalEditPolicy.java:56)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy.activate(CanonicalEditPolicy.java:628)
	at org.eclipse.gef.editparts.AbstractEditPart.activateEditPolicies(AbstractEditPart.java:174)
	at org.eclipse.gef.editparts.AbstractEditPart.activate(AbstractEditPart.java:156)
	at org.eclipse.gef.editparts.AbstractGraphicalEditPart.activate(AbstractGraphicalEditPart.java:195)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$0(GraphicalEditPart.java:1)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.activate(GraphicalEditPart.java:205)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart.activate(DiagramEditPart.java:349)
	at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:215)
	at org.eclipse.gef.editparts.SimpleRootEditPart.setContents(SimpleRootEditPart.java:105)
	at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:617)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer.setContents(DiagramGraphicalViewer.java:352)
	at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:626)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.initializeGraphicalViewerContents(DiagramEditor.java:872)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.initializeGraphicalViewer(DiagramEditor.java:865)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette.initializeGraphicalViewer(DiagramEditorWithFlyOutPalette.java:116)
	at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.initializeGraphicalViewer(DiagramDocumentEditor.java:174)
	at phantom.diagram.part.PhantomDiagramEditor.initializeGraphicalViewer(PhantomDiagramEditor.java:317)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.createGraphicalViewer(DiagramEditor.java:807)
	at org.eclipse.gef.ui.parts.GraphicalEditor.createPartControl(GraphicalEditor.java:171)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.createPartControl(DiagramEditor.java:1580)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette.createPartControl(DiagramEditorWithFlyOutPalette.java:328)
	at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.createPartControl(DiagramDocumentEditor.java:1510)
	at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
	at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
	at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
	at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(EditorAreaHelper.java:271)
	at org.eclipse.ui.internal.EditorManager.setVisibleEditor(EditorManager.java:1459)
	at org.eclipse.ui.internal.EditorManager$5.runWithException(EditorManager.java:972)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
	at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803)
	at org.eclipse.ui.internal.Workbench$33.runWithException(Workbench.java:1600)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2609)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	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:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.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:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

Best Regards,
Nik

[Updated on: Tue, 03 July 2012 10:44]

Report message to a moderator

Re: Error in generated refreshSemantic() [message #893270 is a reply to message #893240] Tue, 03 July 2012 12:35 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Nik,

Sorry to hear that you're having a problem with EuGENia.

Promisingly, the Emfatic in your message actually works fine on my machine. I was able to successfully generate the GMF code using EuGENia and use the graphical editor.

I wonder whether perhaps your workspace contains some remnants of generated code from a previous version of your Emfatic file. Maybe those remnants are causing the compilation errors. Have you tried deleting all of the generated code (i.e., the XXX.diagram, XXX.edit, XXX.editor and XXX.tests projects, as well as the src folder of the XXX project) and then running EuGENia on your Emfatic file?

Hope that helps,
Louis.
Previous Topic:[EOL] Adapter Error The value of type
Next Topic:Running Epsilon using any OSGi implementatino
Goto Forum:
  


Current Time: Fri Apr 19 21:59:08 GMT 2024

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

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

Back to the top